org.jppf.server.protocol
Class FileLocation
java.lang.Object
org.jppf.server.protocol.AbstractLocation<File>
org.jppf.server.protocol.FileLocation
- All Implemented Interfaces:
- Serializable, Location<File>
public class FileLocation
- extends AbstractLocation<File>
Wrapper fro manipulating a file.
- Author:
- Laurent Cohen
- See Also:
- Serialized Form
|
Constructor Summary |
FileLocation(File file)
Initialize this location with the specified file path. |
FileLocation(String file)
Initialize this location with the specified file path. |
FileLocation
public FileLocation(File file)
- Initialize this location with the specified file path.
- Parameters:
file - an abstract file path.
FileLocation
public FileLocation(String file)
- Initialize this location with the specified file path.
- Parameters:
file - an abstract file path.
getInputStream
public InputStream getInputStream()
throws Exception
- Obtain an input stream to read from this location.
- Returns:
- an
InputStream instance.
- Throws:
Exception - if an I/O error occurs.- See Also:
Location.getInputStream()
getOutputStream
public OutputStream getOutputStream()
throws Exception
- Obtain an output stream to write to this location.
- Returns:
- an
OutputStream instance.
- Throws:
Exception - if an I/O error occurs.- See Also:
Location.getOutputStream()
size
public long size()
- Get the size of the file this location points to.
- Returns:
- the size as a long value, or -1 if the file does not exist.
- See Also:
Location.size()
Copyright © 2005-2010 JPPF Team.