|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HostFile
A reference to a file on a host. This object is always associated with a HostSession.
| Method Summary | |
|---|---|
boolean |
canExecute()
Tests whether the file or directory can be executed. |
boolean |
canRead()
Tests whether the file or directory can be read. |
boolean |
canWrite()
Tests whether the file or directory can be written. |
boolean |
delete()
Deletes the host file or directory. |
boolean |
deleteRecursively()
Deletes the host directory recursively, first deleting its contents and then the directory itself. |
boolean |
deleteRecursively(java.lang.String exclusion)
Deprecated. Will be removed very soon. |
boolean |
exists()
Tests whether the file or directory exists. |
java.io.InputStream |
get()
Opens the host file for reading. |
void |
get(java.io.File file)
Copies the content of the host file to a file. |
void |
get(java.io.OutputStream out)
Copies the content of the host file to a stream. |
HostFile |
getFile(java.lang.String name)
Returns a new HostFile with this file as its parent. |
java.lang.String |
getName()
Returns the name of the host file or directory. |
java.lang.String |
getParent()
Returns the path of the parent of the host file or directory. |
HostFile |
getParentFile()
Returns the a new HostFile referring to the parent of the host file or directory. |
java.lang.String |
getPath()
Returns the path. |
HostSession |
getSession()
Returns the session this file is associated with. |
boolean |
isDirectory()
Tests whether this file is a directory. |
long |
length()
Returns the length of this file. |
java.util.List<java.lang.String> |
list()
Returns a list of strings naming the files and directories contained by the host directory. |
java.util.List<HostFile> |
listFiles()
Returns a list of HostFile objects for the files and directories contained by the host directory. |
void |
mkdir()
Creates the directory on the host. |
void |
mkdirs()
Creates the directory on the host, including any missing parent directories if needed. |
void |
moveTo(HostFile destFile)
Moves/renames this file to the target file atomically. |
void |
put(java.io.File file)
Copies the contact of a local file to the host file. |
void |
put(java.io.InputStream in,
long length)
Copies the contents of a stream to the host file. |
java.io.OutputStream |
put(long length)
Opens the host file for writing. |
void |
put(org.springframework.core.io.Resource resource)
Copies the contact of a resource to the host file. |
| Method Detail |
|---|
HostSession getSession()
HostFile getFile(java.lang.String name)
throws RuntimeIOException
this.getSession().getHostFile(this, name)
name - the name of the file in the directory
RuntimeIOException - if an I/O error occursjava.lang.String getPath()
java.lang.String getName()
java.lang.String getParent()
HostFile getParentFile()
null if the host file or directory has no parent.
boolean exists()
throws RuntimeIOException
true if and only if the file or directory exists on the host; false otherwise
RuntimeIOException - if an I/O error occurs
boolean isDirectory()
throws RuntimeIOException
true if and only if the file exists and is a directory; false
otherwise
RuntimeIOException - if an I/O error occurs
long length()
throws RuntimeIOException
RuntimeIOException - if an I/O error occurs
boolean canRead()
throws RuntimeIOException
true if and only if the file or directory is readable on the host; false
otherwise
RuntimeIOException - if an I/O error occurs
boolean canWrite()
throws RuntimeIOException
true if and only if the file or directory is writable on the host; false
otherwise
RuntimeIOException - if an I/O error occurs
boolean canExecute()
throws RuntimeIOException
true if and only if the file or directory is executable on the host; false
otherwise
RuntimeIOException - if an I/O error occurs
java.util.List<java.lang.String> list()
throws RuntimeIOException
RuntimeIOException - if an I/O error occurs or this file does not denote a directory.
java.util.List<HostFile> listFiles()
throws RuntimeIOException
RuntimeIOException - if an I/O error occurs or this file does not denote a directory.
void mkdir()
throws RuntimeIOException
RuntimeIOException - if an I/O error occurs
void mkdirs()
throws RuntimeIOException
RuntimeIOException - if an I/O error occursvoid moveTo(HostFile destFile)
destFile - the destination file.
RuntimeIOException - if an I/O error occurs or the underlying implementation cannot move/rename the file.
boolean delete()
throws RuntimeIOException
false is
returned.
true if the host file or directory existed before the deletion; false otherwise
RuntimeIOException - if an I/O error occurs
boolean deleteRecursively()
throws RuntimeIOException
delete() method. If the
directory does not exists on the host, false is returned.
true if the host file or directory existed before the deletion; false otherwise
RuntimeIOException - if an I/O error occurs
boolean deleteRecursively(java.lang.String exclusion)
throws RuntimeIOException
exclusion.
true if the host file or directory existed before the deletion; false otherwise
RuntimeIOException - if an I/O error occurs
java.io.InputStream get()
throws RuntimeIOException
RuntimeIOException - if an I/O error occurs
void get(java.io.OutputStream out)
throws RuntimeIOException
out - the stream to copy to
RuntimeIOException - if an I/O error occurs
void get(java.io.File file)
throws RuntimeIOException
file - the file to copy to
RuntimeIOException - if an I/O error occurs
java.io.OutputStream put(long length)
throws RuntimeIOException
length - the number of bytes that will be written to the stream
RuntimeIOException - if an I/O error occurs
void put(java.io.InputStream in,
long length)
throws RuntimeIOException
in - the stream to copy fromlength - the number of bytes that will be written to the stream
RuntimeIOException - if an I/O error occurs
void put(java.io.File file)
throws RuntimeIOException
file - the file to copy from
RuntimeIOException - if an I/O error occurs
void put(org.springframework.core.io.Resource resource)
throws RuntimeIOException
resource - the resource to copy
RuntimeIOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||