public class FileSystemFile extends java.lang.Object implements LocalSourceFile, LocalDestFile
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
FileSystemFile(java.io.File file) |
FileSystemFile(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
FileSystemFile |
getChild(java.lang.String name) |
java.lang.Iterable<FileSystemFile> |
getChildren(LocalFileFilter filter) |
java.io.File |
getFile() |
java.io.InputStream |
getInputStream() |
long |
getLastAccessTime()
Returns last access time for the underlying file.
|
long |
getLastModifiedTime()
Returns last access time for the underlying file.
|
long |
getLength() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
int |
getPermissions()
Returns the permissions for the underlying file
|
FileSystemFile |
getTargetDirectory(java.lang.String dirname)
Allows caller to express intent that caller expects to write to directory with
dirname. |
FileSystemFile |
getTargetFile(java.lang.String filename)
Allows caller to express intent that caller expects to write to file with
filename. |
int |
hashCode() |
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
providesAtimeMtime() |
void |
setLastAccessedTime(long t)
Set the last access time for the underlying file.
|
void |
setLastModifiedTime(long t)
Set the last modified time for the underlying file.
|
void |
setPermissions(int perms)
Set the permissions for the underlying file.
|
java.lang.String |
toString() |
public FileSystemFile(java.lang.String path)
public FileSystemFile(java.io.File file)
public java.io.File getFile()
public java.lang.String getName()
getName in interface LocalSourceFilepublic boolean isFile()
isFile in interface LocalSourceFilepublic boolean isDirectory()
isDirectory in interface LocalSourceFilepublic long getLength()
getLength in interface LocalSourceFilepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface LocalSourceFilejava.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface LocalDestFilejava.io.IOExceptionpublic java.lang.Iterable<FileSystemFile> getChildren(LocalFileFilter filter) throws java.io.IOException
getChildren in interface LocalSourceFilejava.io.IOExceptionpublic boolean providesAtimeMtime()
providesAtimeMtime in interface LocalSourceFilepublic long getLastAccessTime()
throws java.io.IOException
LocalSourceFilegetLastAccessTime in interface LocalSourceFilejava.io.IOExceptionpublic long getLastModifiedTime()
throws java.io.IOException
LocalSourceFilegetLastModifiedTime in interface LocalSourceFilejava.io.IOExceptionpublic int getPermissions()
throws java.io.IOException
LocalSourceFilegetPermissions in interface LocalSourceFilejava.io.IOExceptionpublic void setLastAccessedTime(long t)
throws java.io.IOException
LocalDestFilesetLastAccessedTime in interface LocalDestFilet - time in seconds since Unix epochjava.io.IOExceptionpublic void setLastModifiedTime(long t)
throws java.io.IOException
LocalDestFilesetLastModifiedTime in interface LocalDestFilet - time in seconds since Unix epochjava.io.IOExceptionpublic void setPermissions(int perms)
throws java.io.IOException
LocalDestFilesetPermissions in interface LocalDestFileperms - permissions e.g. 0644java.io.IOExceptionpublic FileSystemFile getChild(java.lang.String name)
getChild in interface LocalDestFilename.public FileSystemFile getTargetFile(java.lang.String filename) throws java.io.IOException
LocalDestFilefilename. Based on this
information, an implementation may return an alternate file to write to, which should be respected by the
caller.getTargetFile in interface LocalDestFilejava.io.IOExceptionpublic FileSystemFile getTargetDirectory(java.lang.String dirname) throws java.io.IOException
LocalDestFiledirname. Based on this
information, an implementation may return an alternate directory to write to, which should be respected by the
caller.getTargetDirectory in interface LocalDestFilejava.io.IOExceptionpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object