FileConnectionWrapper fConnWrap = null;
FilePropertiesObject fileProObj = null;
try {
fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );
ExtendedFileConnection fConn = (ExtendedFileConnection) fConnWrap.getFileConnection();
Boolean isReadonly = new Boolean( !fConn.canWrite() );
Boolean isHidden = new Boolean( fConn.isHidden() );
Double size = new Double( fConn.fileSize() );
Date dateModified = new Date( fConn.lastModified() );
int dotIndex = ( args[ 0 ].toString() ).lastIndexOf( (int) '.' );
String fileExtension = "";
if( dotIndex >= 0 ) {
fileExtension = ( args[ 0 ].toString() ).substring( dotIndex );
}
String directory = "file://" + fConn.getPath();
String mimeType = MIMETypeAssociations.getMIMEType( fConn.getName() );
if( mimeType == null ) {
mimeType = "";
}
// get the character encoding by scanning the first 2-4 bytes