Package com.gengoai.io.resource
Class StdoutResource
- java.lang.Object
-
- com.gengoai.io.resource.BaseResource
-
- com.gengoai.io.resource.StdoutResource
-
- All Implemented Interfaces:
NonTraversableResource
,Resource
,WriteOnlyResource
,Serializable
public class StdoutResource extends BaseResource implements NonTraversableResource, WriteOnlyResource
Resource that wraps standard out- 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 inherited from interface com.gengoai.io.resource.Resource
ALL_FILE_PATTERN
-
-
Constructor Summary
Constructors Constructor Description StdoutResource()
-
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.OutputStream
createOutputStream()
Create output stream output stream.boolean
exists()
Exists boolean.Resource
getChild(String relativePath)
Creates a new Resource that is relative to this resource.Resource
getParent()
Gets parent.boolean
mkdir()
Mkdir boolean.boolean
mkdirs()
Mkdirs boolean.-
Methods inherited from class com.gengoai.io.resource.BaseResource
asFile, asURI, baseName, canRead, canWrite, compressed, createInputStream, 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, getChildren, getChildren, getChildren, getChildren, getChildren
-
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, outputStream, path, readBytes, reader, readLines, readObject, readToString, setCharset, setCompression, setIsCompressed, uncompressed, write, write, writeObject, writer
-
Methods inherited from interface com.gengoai.io.resource.WriteOnlyResource
canRead, canWrite, lines
-
-
-
-
Method Detail
-
createOutputStream
public OutputStream createOutputStream() throws IOException
Description copied from class:BaseResource
Create output stream output stream.- Overrides:
createOutputStream
in classBaseResource
- Returns:
- the output stream
- Throws:
IOException
- the io exception
-
exists
public boolean exists()
Description copied from interface:Resource
Exists boolean.
-
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
-
mkdir
public boolean mkdir()
Description copied from interface:Resource
Mkdir boolean.- Specified by:
mkdir
in interfaceResource
- Returns:
- the boolean
- See Also:
java.io.File#mkdir()java.io.File#mkdir()java.io.File#mkdir()java.io.File#mkdir()
-
mkdirs
public boolean mkdirs()
Description copied from interface:Resource
Mkdirs boolean.- Specified by:
mkdirs
in interfaceResource
- Returns:
- the boolean
- See Also:
java.io.File#mkdirs()java.io.File#mkdirs()java.io.File#mkdirs()java.io.File#mkdirs()
-
getParent
public Resource getParent()
Description copied from interface:Resource
Gets parent.- Specified by:
getParent
in interfaceNonTraversableResource
- Specified by:
getParent
in interfaceResource
- Returns:
- The parent resource (directory for file, parent directory for a directory)
-
getChild
public Resource getChild(String relativePath)
Description copied from interface:Resource
Creates a new Resource that is relative to this resource.
- Specified by:
getChild
in interfaceNonTraversableResource
- Specified by:
getChild
in interfaceResource
- Parameters:
relativePath
- The relative path for the new resource.- Returns:
- A new resource that is relative to this resource.
-
-