Package eu.mihosoft.vmf.core.io
Class FileResource
- java.lang.Object
-
- eu.mihosoft.vmf.core.io.FileResource
-
- All Implemented Interfaces:
Resource
,java.lang.AutoCloseable
public class FileResource extends java.lang.Object implements Resource
A file resource.- See Also:
MemoryResource
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.io.File
getFile()
Returns the file object associated with this resource set.java.io.PrintWriter
open()
Opens this resource for writing.java.io.InputStream
openForReading()
Opens this resource for reading.java.io.OutputStream
openForWriting()
Opens this resource for writing.
-
-
-
Method Detail
-
getFile
public java.io.File getFile()
Returns the file object associated with this resource set.- Returns:
- file object
-
open
public java.io.PrintWriter open() throws java.io.IOException
Description copied from interface:Resource
Opens this resource for writing.
-
close
public void close() throws java.io.IOException
-
openForReading
public java.io.InputStream openForReading() throws java.io.IOException
Description copied from interface:Resource
Opens this resource for reading.- Specified by:
openForReading
in interfaceResource
- Returns:
- input stream to read from this resource
- Throws:
java.io.IOException
- if an I/O related problem prevents this operation
-
openForWriting
public java.io.OutputStream openForWriting() throws java.io.IOException
Description copied from interface:Resource
Opens this resource for writing.- Specified by:
openForWriting
in interfaceResource
- Returns:
- output stream to write from this resource
- Throws:
java.io.IOException
- if an I/O related problem prevents this operation
-
-