Package com.gengoai.io.resource
Class EmptyResource
- java.lang.Object
-
- com.gengoai.io.resource.BaseResource
-
- com.gengoai.io.resource.EmptyResource
-
- All Implemented Interfaces:
NonTraversableResource
,Resource
,Serializable
public class EmptyResource extends BaseResource implements NonTraversableResource
An empty resource- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.gengoai.io.resource.Resource
Resource.Deserializer
-
-
Field Summary
Fields Modifier and Type Field Description static EmptyResource
INSTANCE
The singleton instance-
Fields inherited from interface com.gengoai.io.resource.Resource
ALL_FILE_PATTERN
-
-
Constructor Summary
Constructors Constructor Description EmptyResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
append(byte[] byteArray)
Appends the given byte array content to the resource.boolean
canRead()
Returnstrue
if the resource is readable,false
if not.boolean
canWrite()
Returnstrue
if the resource is writable,false
if not.boolean
exists()
Exists boolean.-
Methods inherited from class com.gengoai.io.resource.BaseResource
asFile, asURI, baseName, compressed, createInputStream, createOutputStream, descriptor, getCharset, inputStream, isCompressed, isDirectory, outputStream, path, setCharset, setCompression, setIsCompressed, toString, uncompressed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.gengoai.io.resource.NonTraversableResource
childIterator, childIterator, getChild, getChildren, getChildren, getChildren, getChildren, getChildren, getParent
-
Methods inherited from interface com.gengoai.io.resource.Resource
append, asFile, asPath, asURI, asURL, baseName, compressed, copy, delete, delete, deleteOnExit, descriptor, forEach, getCharset, inputStream, isCompressed, isDirectory, lines, mkdir, mkdirs, outputStream, path, readBytes, reader, readLines, readObject, readToString, setCharset, setCompression, setIsCompressed, uncompressed, write, write, writeObject, writer
-
-
-
-
Field Detail
-
INSTANCE
public static final EmptyResource INSTANCE
The singleton instance
-
-
Method Detail
-
append
public Resource append(byte[] byteArray) throws IOException
Description copied from interface:Resource
Appends the given byte array content to the resource.
- Specified by:
append
in interfaceResource
- Parameters:
byteArray
- The content to append- Returns:
- the resource
- Throws:
IOException
- the io exception
-
exists
public boolean exists()
Description copied from interface:Resource
Exists boolean.
-
canWrite
public boolean canWrite()
Description copied from interface:Resource
Returnstrue
if the resource is writable,false
if not.- Specified by:
canWrite
in interfaceResource
- Overrides:
canWrite
in classBaseResource
- Returns:
- True if can write to the resource
-
canRead
public boolean canRead()
Description copied from interface:Resource
Returnstrue
if the resource is readable,false
if not.- Specified by:
canRead
in interfaceResource
- Overrides:
canRead
in classBaseResource
- Returns:
- True if can read from the resource
-
-