Package snap.web

Class FileHeader

All Implemented Interfaces:
PropChange.DoChange

public class FileHeader extends PropObject
A class to hold basic information for a generic file.
  • Field Details

  • Constructor Details

    • FileHeader

      public FileHeader(String aPath, boolean isDir)
      Constructor for path and directory.
    • FileHeader

      public FileHeader(WebFile aFile)
      Constructor for file.
  • Method Details

    • getPath

      public String getPath()
      Returns the file path.
    • setPath

      public void setPath(String aPath)
      Sets the file path.
    • getName

      public String getName()
      Returns the resource name.
    • getSimpleName

      public String getSimpleName()
      Returns the file simple name.
    • getType

      public String getType()
      Returns the file type (extension without the '.').
    • getDirPath

      public String getDirPath()
      Returns the path as a directory (with trailing separator).
    • isDir

      public boolean isDir()
      Returns whether file is a directory.
    • isFile

      public boolean isFile()
      Returns whether file is a plain file.
    • isRoot

      public boolean isRoot()
      Returns whether this file is root directory.
    • getLastModTime

      public long getLastModTime()
      Returns the file last modified time.
    • setLastModTime

      public void setLastModTime(long aTime)
      Sets the file last modified time.
    • getSize

      public long getSize()
      Returns the file size.
    • setSize

      public void setSize(long aSize)
      Sets the file size.
    • getMimeType

      public String getMimeType()
      Returns the file MIME type.
    • setMimeType

      public void setMimeType(String aMIMEType)
      Sets the file MIME type.
    • getLinkUrl

      public WebURL getLinkUrl()
      Returns the link URL.
    • setLinkUrl

      public void setLinkUrl(WebURL aURL)
      Sets the link URL.
    • toStringProps

      public String toStringProps()
      Returns a string representation of file.
      Overrides:
      toStringProps in class PropObject