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,
                       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,
                       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,
                       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

      • 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
      • 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

        Value: The file unique identifier.
        Parameters:
        value - the value
      • getName

        public String getName()

        The file name.


         The following example demonstrates how to set name of the document.
         
         String guid = "C:\\storage\\document.doc";
         FileDescription fileDescription = new FileDescription(guid);
         String name = fileDescription.getName();
         //Result will be "document.doc".
         

      • setName

        public void setName(String value)

        The file name.

      • getExtension

        public String getExtension()

        Gets the file extension.


         The following example demonstrates how to get extension of the file.
         
         String guid = "C:\\storage\\document.doc";
         FileDescription fileDescription = new FileDescription(guid);
         String extension = fileDescription.getExtension();
         //Result will be "doc".
         

      • getSize

        public long getSize()

        The size in bytes.

      • setSize

        public void setSize(long value)

        The size in bytes.

      • getLastModificationDate

        public Date getLastModificationDate()

        The last modification date.

      • getLastModificationDateInternal

        public com.aspose.ms.System.DateTime getLastModificationDateInternal()
        Gets last modification date internal.
        Returns:
        the last modification date internal
      • setLastModificationDate

        public void setLastModificationDate(Date value)

        The last modification date.

      • setLastModificationDateInternal

        public void setLastModificationDateInternal(com.aspose.ms.System.DateTime value)
        Sets last modification date internal.
        Parameters:
        value - the value
      • getBaseName

        public String getBaseName()

        Gets base name of the document.


         The following example demonstrates how to get base name of the document.
         
         String guid = "C:\\storage\\document.doc";
         FileDescription fileDescription = new FileDescription(guid);
         String baseName = fileDescription.getBaseName();
         //Result will be "document".
         

      • isDirectory

        public boolean isDirectory()

        Indicates whether file or folder.

      • setDirectory

        public void setDirectory(boolean value)

        Indicates whether file or folder.

      • getDocumentType

        public String getDocumentType()

        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.
      • getFileType

        public String getFileType()

        The type of the file.

        Value: The type of the file.
        Returns:
        the file type
      • getDocumentTypeFormat

        public String getDocumentTypeFormat()

        The document type format.

        Returns:
        Domain.DocumentTypeFormat.PORTABLE_DOCUMENT_FORMAT, Domain.DocumentTypeFormat.MICROSOFT_WORD, Domain.DocumentTypeFormat.MICROSOFT_EXCEL, Domain.DocumentTypeFormat.MICROSOFT_POWERPOINT, Domain.DocumentTypeFormat.MICROSOFT_VISIO, Domain.DocumentTypeFormat.MICROSOFT_PROJECT, Domain.DocumentTypeFormat.MICROSOFT_OUTLOOK, Domain.DocumentTypeFormat.OPENDOCUMENT_FORMATS, Domain.DocumentTypeFormat.RICH_TEXT_FORMAT, Domain.DocumentTypeFormat.PLAIN_TEXT_FILE, Domain.DocumentTypeFormat.COMMA_SEPARATED_VALUES, Domain.DocumentTypeFormat.HYPERTEXT_MARKUP_LANGUAGE, Domain.DocumentTypeFormat.EXTENSIBLE_MARKUP_LANGUAGE, Domain.DocumentTypeFormat.XML_PAPER_SPECIFICATION, Domain.DocumentTypeFormat.IMAGE_FILES, Domain.DocumentTypeFormat.ELECTRONIC_PUBLICATION, Domain.DocumentTypeFormat.WINDOWS_ICON, Domain.DocumentTypeFormat.DICOM_DRAWING_FILE_FORMAT, Domain.DocumentTypeFormat.MOBIPOCKET or Domain.DocumentTypeFormat.UNKNOWN
      • getDocType

        public int getDocType()

        The type of the document.

        Value: The type of the document.
        Returns:
        the doc type