Class FileData

  • Direct Known Subclasses:
    BunchFileData, RemoteJarFile

    public class FileData
    extends java.lang.Object
    A 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 boolean directory
      The boolean for directory.
      protected java.lang.String displayname
      The display name.
      protected boolean exists
      The boolean for existance.
      protected java.lang.String filename
      The file name.
      protected long filesize
      The file size.
      protected long lastmodified
      The last modified date.
      protected java.lang.String path
      The path.
      protected int prefix
      The prefix length.
      protected char separator
      The 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.
    • 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:
        toString in class java.lang.Object
        Returns:
        The string representation.