|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xebialabs.deployit.hostsession.common.AbstractHostFile
public abstract class AbstractHostFile
Abstract base class with common methods used by actual implementations of HostFile.
| Field Summary | |
|---|---|
protected HostSession |
session
|
| Constructor Summary | |
|---|---|
AbstractHostFile(HostSession session)
|
|
| Method Summary | |
|---|---|
boolean |
deleteRecursively()
Deletes the host directory recursively, first deleting its contents and then the directory itself. |
boolean |
deleteRecursively(java.lang.String exclusion)
Similar to deleteRecursively(), except that any filename matching exclusion. |
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. |
HostFile |
getParentFile()
Returns the a new HostFile referring to the parent of the host file or directory. |
HostSession |
getSession()
Returns the session this file is associated with. |
java.util.List<HostFile> |
listFiles()
Returns a list of HostFile objects for the files and directories contained by the host directory. |
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. |
void |
put(org.springframework.core.io.Resource resource)
Copies the contact of a resource to the host file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.xebialabs.deployit.hostsession.HostFile |
|---|
canExecute, canRead, canWrite, delete, exists, get, getName, getParent, getPath, isDirectory, length, list, mkdir, mkdirs, moveTo, put |
| Field Detail |
|---|
protected HostSession session
| Constructor Detail |
|---|
public AbstractHostFile(HostSession session)
| Method Detail |
|---|
public HostSession getSession()
HostFile
getSession in interface HostFilepublic HostFile getFile(java.lang.String name)
HostFilethis.getSession().getHostFile(this, name)
getFile in interface HostFilename - the name of the file in the directory
public HostFile getParentFile()
HostFilenull if the host file or directory has no parent.
getParentFile in interface HostFile
public java.util.List<HostFile> listFiles()
throws RuntimeIOException
HostFile
listFiles in interface HostFileRuntimeIOException - if an I/O error occurs or this file does not denote a directory.
public boolean deleteRecursively()
throws RuntimeIOException
HostFileHostFile.delete() method. If the
directory does not exists on the host, false is returned.
deleteRecursively in interface HostFiletrue if the host file or directory existed before the deletion; false otherwise
RuntimeIOException - if an I/O error occurs
public boolean deleteRecursively(java.lang.String exclusion)
throws RuntimeIOException
HostFileexclusion.
deleteRecursively in interface HostFiletrue if the host file or directory existed before the deletion; false otherwise
RuntimeIOException - if an I/O error occurs
public void get(java.io.OutputStream out)
throws RuntimeIOException
HostFile
get in interface HostFileout - the stream to copy to
RuntimeIOException - if an I/O error occurs
public void get(java.io.File file)
throws RuntimeIOException
HostFile
get in interface HostFilefile - the file to copy to
RuntimeIOException - if an I/O error occurs
public void put(java.io.InputStream in,
long length)
throws RuntimeIOException
HostFile
put in interface HostFilein - the stream to copy fromlength - the number of bytes that will be written to the stream
RuntimeIOException - if an I/O error occurs
public void put(java.io.File file)
throws RuntimeIOException
HostFile
put in interface HostFilefile - the file to copy from
RuntimeIOException - if an I/O error occurs
public void put(org.springframework.core.io.Resource resource)
throws RuntimeIOException
HostFile
put in interface HostFileresource - 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 | |||||||||