public abstract class ApplicationFile extends Object implements Comparable<ApplicationFile>
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationFile.MetaData |
static interface |
ApplicationFile.PathFilter |
Modifier and Type | Field and Description |
---|---|
static String |
ContentStatusChanged |
static String |
ContentStatusDeleted |
static String |
ContentStatusNew |
protected com.yahoo.path.Path |
path |
Modifier | Constructor and Description |
---|---|
protected |
ApplicationFile(com.yahoo.path.Path path) |
Modifier and Type | Method and Description |
---|---|
abstract ApplicationFile |
appendFile(String value)
Appends the given string to this text file.
|
abstract ApplicationFile |
createDirectory()
Create a directory at the path represented by this file.
|
abstract InputStream |
createInputStream()
Create an
InputStream for the contents of this file. |
abstract Reader |
createReader()
Create a
Reader for the contents of this file. |
abstract ApplicationFile |
delete()
Delete the file pointed to by this.
|
boolean |
equals(Object other) |
abstract boolean |
exists()
Test whether or not this file exists.
|
abstract ApplicationFile.MetaData |
getMetaData() |
protected com.yahoo.path.Path |
getMetaPath() |
com.yahoo.path.Path |
getPath()
Get the path that this file represents.
|
abstract boolean |
isDirectory()
Check whether or not this file is a directory.
|
List<ApplicationFile> |
listFiles()
List the files under this directory.
|
abstract List<ApplicationFile> |
listFiles(ApplicationFile.PathFilter filter)
List the files under this directory.
|
List<ApplicationFile> |
listFiles(boolean recurse)
List the files in this directory, optionally list files for subdirectories recursively as well.
|
String |
toString() |
abstract ApplicationFile |
writeFile(Reader input)
Write the contents from this reader to this file.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compareTo
public static final String ContentStatusNew
public static final String ContentStatusChanged
public static final String ContentStatusDeleted
protected final com.yahoo.path.Path path
public abstract boolean isDirectory()
public abstract boolean exists()
public abstract Reader createReader() throws FileNotFoundException
Reader
for the contents of this file.Reader
that should be closed after use.FileNotFoundException
- if the file is not found.public abstract InputStream createInputStream() throws FileNotFoundException
InputStream
for the contents of this file.InputStream
that should be closed after use.FileNotFoundException
- if the file is not found.public abstract ApplicationFile createDirectory()
IllegalArgumentException
- if the directory already exists.public abstract ApplicationFile writeFile(Reader input)
input
- A reader pointing to the content that should be written.public abstract ApplicationFile appendFile(String value)
public List<ApplicationFile> listFiles()
public abstract List<ApplicationFile> listFiles(ApplicationFile.PathFilter filter)
filter
- A filter functor for filtering path namespublic List<ApplicationFile> listFiles(boolean recurse)
recurse
- Set to true if all files in the directory tree should be returned.public abstract ApplicationFile delete()
RuntimeException
- if the file is a directory and not empty.public com.yahoo.path.Path getPath()
protected com.yahoo.path.Path getMetaPath()
public abstract ApplicationFile.MetaData getMetaData()
Copyright © 2018. All rights reserved.