Package snap.web
Class FileHeader
java.lang.Object
snap.props.PropObject
snap.web.FileHeader
- All Implemented Interfaces:
PropChange.DoChange
A class to hold basic information for a generic file.
-
Field Summary
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
ConstructorDescriptionFileHeader
(String aPath, boolean isDir) Constructor for path and directory.FileHeader
(WebFile aFile) Constructor for file. -
Method Summary
Modifier and TypeMethodDescriptionReturns the path as a directory (with trailing separator).long
Returns the file last modified time.Returns the link URL.Returns the file MIME type.getName()
Returns the resource name.getPath()
Returns the file path.Returns the file simple name.long
getSize()
Returns the file size.getType()
Returns the file type (extension without the '.').boolean
isDir()
Returns whether file is a directory.boolean
isFile()
Returns whether file is a plain file.boolean
isRoot()
Returns whether this file is root directory.void
setLastModTime
(long aTime) Sets the file last modified time.void
setLinkUrl
(WebURL aURL) Sets the link URL.void
setMimeType
(String aMIMEType) Sets the file MIME type.void
Sets the file path.void
setSize
(long aSize) Sets the file size.Returns a string representation of file.Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, clone, firePropChange, firePropChange, firePropChange, getPropDefault, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValue, setPropValues, toString
-
Field Details
-
LastModTime_Prop
- See Also:
-
Size_Prop
- See Also:
-
MIMEType_Prop
- See Also:
-
-
Constructor Details
-
FileHeader
Constructor for path and directory. -
FileHeader
Constructor for file.
-
-
Method Details
-
getPath
Returns the file path. -
setPath
Sets the file path. -
getName
Returns the resource name. -
getSimpleName
Returns the file simple name. -
getType
Returns the file type (extension without the '.'). -
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
Returns the file MIME type. -
setMimeType
Sets the file MIME type. -
getLinkUrl
Returns the link URL. -
setLinkUrl
Sets the link URL. -
toStringProps
Returns a string representation of file.- Overrides:
toStringProps
in classPropObject
-