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).Returns the file MIME type.long
Returns the file modification time.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
setMimeType
(String aMIMEType) Sets the file MIME type.void
setModTime
(long aTime) Sets the file modification time.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, getPropValue, initProps, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropValue, 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. -
getModTime
public long getModTime()Returns the file modification time. -
setModTime
public void setModTime(long aTime) Sets the file modification 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. -
toStringProps
Returns a string representation of file.- Overrides:
toStringProps
in classPropObject
-