public abstract class SCMFile extends Object
SCMFileSystem.| Constructor and Description |
|---|
SCMFile() |
| Modifier and Type | Method and Description |
|---|---|
abstract Iterable<SCMFile> |
children()
If this object represents a directory, lists up all the immediate children.
|
abstract InputStream |
content()
Reads the content of this file.
|
byte[] |
contentAsBytes()
A convenience method that reads the content and then turns it into a byte array.
|
String |
contentAsString()
A convenience method that reads the content and then turns it into a string.
|
Charset |
contentEncoding()
Encoding of this file.
|
String |
contentMimeType()
Returns the MIME type of this file.
|
abstract SCMFile |
get(String path)
Gets a child/descendant path relative from this object.
|
abstract String |
getName()
Gets the file name of this file without any path portion, such as just "foo.txt"
This method is the equivalent of
File.getName() |
boolean |
isContentBinary()
Checks if this file is a binary file.
|
boolean |
isContentText()
The opposite of
isContentBinary() |
boolean |
isDirectory()
Returns true if this object represents a directory.
|
abstract boolean |
isFile()
Returns true if this object represents a file.
|
@NonNull public abstract String getName()
File.getName()@CheckForNull public abstract SCMFile get(String path) throws IOException
IOException@NonNull public abstract Iterable<SCMFile> children() throws IOException
File.listFiles().IOExceptionpublic abstract boolean isFile()
throws IOException
File.isFile()IOExceptionpublic boolean isDirectory()
throws IOException
File.isDirectory()IOException@NonNull public abstract InputStream content() throws IOException
IOException - if this object represents a directory.@NonNull
public byte[] contentAsBytes()
throws IOException
IOException - if this object represents a directory.@NonNull public String contentAsString() throws IOException
IOException - if this object represents a directory.@NonNull public String contentMimeType() throws IOException
IOExceptionpublic boolean isContentBinary()
throws IOException
IOExceptionpublic boolean isContentText()
throws IOException
isContentBinary()IOException@NonNull public Charset contentEncoding() throws IOException
IOExceptionCopyright © 2004-2013. All Rights Reserved.