The interface specifies methods in addition to StreamWritable. Subclasses should override these to provide a more efficient implementation.
public default ByteArrayRegion | getBytes() Gets the raw contents of the file as a byte array. |
public default String | Gets the contents of the file as a String. |
public String | getName() Gets the name of the file. |
public default ByteSource | Opens a ByteSource to the contents of the file. |
public default InputStream | Opens an InputStream to the contents of the file. |
From: StreamWritable |
The default implementation converts the raw byte contents of the file is to string by decoding it as UTF-8 encoded data.
The name of the file should be considered final and not change during the lifetime of the object.
The name may not be null
, empty, "."
or ".."
, must not contain slash
characters ('/'
, '\\'
), and must not contain the colon (':'
) and semicolon
(';'
) characters.
Note that in some cases the above restriction may be violated, when root directories need to be represented. They
will have a name according to the root path name they represent. I.e. They can be "/"
, or drive
names in "drive:"
format. These root directories cannot be added to other directories.