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

      • getBaseName

        @Deprecated
        public String getBaseName()
        Deprecated. 

        Gets base name of the document.

        The following example demonstrates how to get base name of the document.
        Returns:
        a String object.
      • getDocumentType

        @Deprecated
        public String getDocumentType()
        Deprecated. 

        Type of the document.

        Returns:
        DocumentTypeName.WORDS, DocumentTypeName.CELLS, DocumentTypeName.SLIDES, DocumentTypeName.PDF, DocumentTypeName.DIAGRAM, DocumentTypeName.PROJECT, DocumentTypeName.IMAGE, DocumentTypeName.TAGGEDIMAGE, DocumentTypeName.CAD. DocumentTypeName.EMAIL. DocumentTypeName.DJVU. DocumentTypeName.DICOM. DocumentTypeName.UNKNOWN.
      • getDocumentTypeFormat

        @Deprecated
        public String getDocumentTypeFormat()
        Deprecated. 

        The document type format.

        Returns:
        Domain.DocumentTypeFormat.PORTABLE_DOCUMENT_FORMAT, Domain.DocumentTypeFormat.MICROSOFT_WORD, Domain.FileFormat.PORTABLE_DOCUMENT_FORMAT, Domain.FileFormat.MICROSOFT_WORD, Domain.FileFormat.MICROSOFT_EXCEL, Domain.FileFormat.MICROSOFT_POWERPOINT, Domain.FileFormat.MICROSOFT_VISIO, Domain.FileFormat.MICROSOFT_PROJECT, Domain.FileFormat.MICROSOFT_OUTLOOK, Domain.FileFormat.OPENDOCUMENT_FORMATS, Domain.FileFormat.RICH_TEXT_FORMAT, Domain.FileFormat.PLAIN_TEXT_FILE, Domain.FileFormat.COMMA_SEPARATED_VALUES, Domain.FileFormat.HYPERTEXT_MARKUP_LANGUAGE, Domain.FileFormat.EXTENSIBLE_MARKUP_LANGUAGE, Domain.FileFormat.XML_PAPER_SPECIFICATION, Domain.FileFormat.IMAGE_FILES, Domain.FileFormat.ELECTRONIC_PUBLICATION, Domain.FileFormat.WINDOWS_ICON, Domain.FileFormat.DICOM_DRAWING_FILE_FORMAT, Domain.FileFormat.MOBIPOCKET or Domain.FileFormat.UNKNOWN
      • 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.
      • getFileType

        public String getFileType()

        The type of the file.

        Returns:
        the file type
      • 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.