Class FileMetaData
java.lang.Object
net.sf.basedb.opengrid.filetransfer.FileMetaData
Class for holding and collecting metadata about a remote
or local file. When uploading a local file to a remote server
the metadata instance is expected to contain information about
the local file. When downloading a file from a remote server
the metadata instance is populate with information about
the remote file before the download starts.
- Since:
- 1.0
- Author:
- nicklas
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private long
private long
private long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
long
Get the timestamp when that the file was last accessed.long
Get the timestamp when the file was last modified.long
getSize()
The number of bytes of the resource or 0 if not known.void
setExists
(boolean exists) void
setLastAccessedTime
(long timestamp) Set the date and time the file was last accessed.void
setLastModifiedTime
(long timestamp) Set the date and time the file was last modified.void
setSize
(long size) Set the size of the file that is about to be downloaded.
-
Field Details
-
size
private long size -
lastModified
private long lastModified -
lastAccessed
private long lastAccessed -
exists
private boolean exists
-
-
Constructor Details
-
FileMetaData
public FileMetaData()
-
-
Method Details
-
exists
public boolean exists()- Since:
- 1.14
-
setExists
public void setExists(boolean exists) - Since:
- 1.14
-
getSize
public long getSize()The number of bytes of the resource or 0 if not known. -
setSize
public void setSize(long size) Set the size of the file that is about to be downloaded. -
getLastModifiedTime
public long getLastModifiedTime()Get the timestamp when the file was last modified.- Returns:
- A Java timestamp or 0 if not supported
-
setLastModifiedTime
public void setLastModifiedTime(long timestamp) Set the date and time the file was last modified.- Parameters:
timestamp
- A Java timestamp
-
getLastAccessedTime
public long getLastAccessedTime()Get the timestamp when that the file was last accessed.- Returns:
- A Java timestamp or 0 if not supported
-
setLastAccessedTime
public void setLastAccessedTime(long timestamp) Set the date and time the file was last accessed.- Parameters:
timestamp
- A Java timestamp
-