Class FileData
- java.lang.Object
-
- jadex.bridge.service.types.filetransfer.FileData
-
- Direct Known Subclasses:
BunchFileData,RemoteJarFile
public class FileData extends java.lang.ObjectA file data represents a java.io.File that can be transferred to remote address spaces. Does only transfer file information, not the binary data itself. This class is necessary, because java.io.File makes too many assumptions about the underlying OS (slashed, root directories), such that File objects are not portable. I.e. a Windows path produces a corrupted File, when instantiated under Linux and vice versa.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandirectoryThe boolean for directory.protected java.lang.StringdisplaynameThe display name.protected booleanexistsThe boolean for existance.protected java.lang.StringfilenameThe file name.protected longfilesizeThe file size.protected longlastmodifiedThe last modified date.protected java.lang.StringpathThe path.protected intprefixThe prefix length.protected charseparatorThe separator char.
-
Constructor Summary
Constructors Constructor Description FileData()Create a new remote file.FileData(java.io.File file)Create a new remote file.FileData(java.lang.String filename, java.lang.String path, boolean directory, boolean exists, java.lang.String displayname, long lastmodified, char separator, int prefix, long filesize)Create a new remote file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileData[]convertToRemoteFiles(java.io.File[] files)Convert files to remote files.java.lang.StringgetDisplayName()Get the displayname.static java.lang.StringgetDisplayName(java.io.File file)Get the display name for a file.java.lang.StringgetFilename()Get the filename.longgetFileSize()Get the filesize.longgetLastModified()Get the lastmodified.java.lang.StringgetPath()Get the path.intgetPrefixLength()Get the prefix.chargetSeparatorChar()Get the separator char.booleanisDirectory()Get the directory.booleanisExists()Get the exists flag.voidsetDirectory(boolean directory)Set the directory.voidsetDisplayName(java.lang.String displayname)Set the displayname.voidsetExists(boolean exists)Set the exists flag.voidsetFilename(java.lang.String filename)Set the filename.voidsetFileSize(long filesize)Set the filesize.voidsetLastModified(long lastmodified)Set the lastmodified.voidsetPath(java.lang.String path)Set the path.voidsetPrefixLength(int prefix)Set the prefix.voidsetSeparatorChar(char separator)Set the separator char.java.lang.StringtoString()Get the string representation.
-
-
-
Field Detail
-
filename
protected java.lang.String filename
The file name.
-
path
protected java.lang.String path
The path.
-
directory
protected boolean directory
The boolean for directory.
-
exists
protected boolean exists
The boolean for existance.
-
displayname
protected java.lang.String displayname
The display name.
-
lastmodified
protected long lastmodified
The last modified date.
-
separator
protected char separator
The separator char.
-
prefix
protected int prefix
The prefix length.
-
filesize
protected long filesize
The file size.
-
-
Constructor Detail
-
FileData
public FileData()
Create a new remote file.
-
FileData
public FileData(java.lang.String filename, java.lang.String path, boolean directory, boolean exists, java.lang.String displayname, long lastmodified, char separator, int prefix, long filesize)Create a new remote file.
-
FileData
public FileData(java.io.File file)
Create a new remote file.
-
-
Method Detail
-
getFilename
public java.lang.String getFilename()
Get the filename.- Returns:
- the filename.
-
setFilename
public void setFilename(java.lang.String filename)
Set the filename.- Parameters:
filename- The filename to set.
-
getPath
public java.lang.String getPath()
Get the path.- Returns:
- the path.
-
setPath
public void setPath(java.lang.String path)
Set the path.- Parameters:
path- The path to set.
-
isDirectory
public boolean isDirectory()
Get the directory.- Returns:
- the directory.
-
setDirectory
public void setDirectory(boolean directory)
Set the directory.- Parameters:
directory- The directory to set.
-
isExists
public boolean isExists()
Get the exists flag.- Returns:
- the exists flag.
-
setExists
public void setExists(boolean exists)
Set the exists flag.- Parameters:
exists- The exists flag to set.
-
getDisplayName
public java.lang.String getDisplayName()
Get the displayname.- Returns:
- the displayname.
-
setDisplayName
public void setDisplayName(java.lang.String displayname)
Set the displayname.- Parameters:
displayname- The displayname to set.
-
getDisplayName
public static java.lang.String getDisplayName(java.io.File file)
Get the display name for a file.
-
getLastModified
public long getLastModified()
Get the lastmodified.- Returns:
- the lastmodified.
-
setLastModified
public void setLastModified(long lastmodified)
Set the lastmodified.- Parameters:
lastmodified- The lastmodified to set.
-
convertToRemoteFiles
public static FileData[] convertToRemoteFiles(java.io.File[] files)
Convert files to remote files.
-
getSeparatorChar
public char getSeparatorChar()
Get the separator char.- Returns:
- the separator char.
-
setSeparatorChar
public void setSeparatorChar(char separator)
Set the separator char.- Parameters:
separator- The separator char to set.
-
getPrefixLength
public int getPrefixLength()
Get the prefix.- Returns:
- the prefix.
-
setPrefixLength
public void setPrefixLength(int prefix)
Set the prefix.- Parameters:
prefix- The prefix to set.
-
getFileSize
public long getFileSize()
Get the filesize.- Returns:
- The filesize.
-
setFileSize
public void setFileSize(long filesize)
Set the filesize.- Parameters:
filesize- The filesize to set.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string representation.
-
-