com.groupdocs.viewer.domain

Class FileDescription

  • Direct Known Subclasses:
    CacheFileDescription


    public class FileDescription
    extends Object

    Represents a container for file description.

    • Constructor Detail

      • FileDescription

        public FileDescription()

        Constructor for unit tests

      • FileDescription

        public FileDescription(String guid)

        Initializes a new instance of the FileDescription class. IsDirectory flag will be set to false.

        Parameters:
        guid - The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt
      • FileDescription

        public FileDescription(String guid,
                       boolean isDirectory)

        Initializes a new instance of the FileDescription class. IsDirectory flag will be set to false.

        Parameters:
        guid - The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt
        isDirectory - Indicates whether file or folder
      • FileDescription

        public FileDescription(String guid,
                       String name)

        Initializes a new instance of the FileDescription class. IsDirectory flag will be set to false.

        Parameters:
        guid - The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt
        name - File name with extension
      • FileDescription

        public FileDescription(String guid,
                       String name,
                       boolean isDirectory)

        Initializes a new instance of the FileDescription class.

        Parameters:
        guid - The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt
        name - File name with extension
        isDirectory - Indicates whether file or folder
    • Method Detail

      • getExtension

        public String getExtension()

        Gets the file extension.

        The following example demonstrates how to get extension of the file.
        Returns:
        a String object.
      • getFileFormat

        public String getFileFormat()

        Gets the file format e.g. "Microsoft Word".


         The following example demonstrates how to get file format.
         
        String guid = "C:\\storage\\document.doc";
         FileDescription fileDescription = new FileDescription(guid);
         System.out.println(fileDescription.getFileFormat());
         //Result will be "Microsoft Word".
         

        Value: The file format.
      • getGuid

        public String getGuid()

        The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt

        Returns:
        the GUID
      • getLastModificationDate

        public Date getLastModificationDate()

        The last modification date.

        Returns:
        a Date object.
      • getName

        public String getName()

        The file name.

        The following example demonstrates how to set name of the document.
        Returns:
        a String object.
      • getSize

        public long getSize()

        The size in bytes.

        Returns:
        a long.
      • isDirectory

        public boolean isDirectory()

        Indicates whether file or folder.

        Returns:
        a boolean.
      • setDirectory

        public void setDirectory(boolean value)

        Indicates whether file or folder.

        Parameters:
        value - a boolean.
      • setGuid

        public void setGuid(String value)

        The file unique identifier, full path for local storage e.g. c:\\storage\\document.txt, relative path e.g document.txt, url e.g. http://site.com/document.txt

        Parameters:
        value - the value
      • setLastModificationDate

        public void setLastModificationDate(Date value)

        The last modification date.

        Parameters:
        value - a Date object.
      • setName

        public void setName(String value)

        The file name.

        Parameters:
        value - a String object.
      • setSize

        public void setSize(long value)

        The size in bytes.

        Parameters:
        value - a long.