Class FileLocation
- java.lang.Object
-
- org.apache.maven.shared.io.location.FileLocation
-
- All Implemented Interfaces:
Location
- Direct Known Subclasses:
ArtifactLocation,URLLocation
public class FileLocation extends java.lang.Object implements Location
file location implementation.
-
-
Constructor Summary
Constructors Modifier Constructor Description FileLocation(java.io.File file, java.lang.String specification)protectedFileLocation(java.lang.String specification)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the location.java.io.FilegetFile()java.io.InputStreamgetInputStream()java.lang.StringgetSpecification()protected voidinitFile()initialize file.voidopen()open the location.intread(byte[] buffer)intread(java.nio.ByteBuffer buffer)protected voidsetFile(java.io.File file)protected java.io.FileunsafeGetFile()
-
-
-
Method Detail
-
getFile
public java.io.File getFile() throws java.io.IOException
-
unsafeGetFile
protected java.io.File unsafeGetFile()
- Returns:
File
-
initFile
protected void initFile() throws java.io.IOExceptioninitialize file.- Throws:
java.io.IOException- in case error.
-
setFile
protected void setFile(java.io.File file)
- Parameters:
file-File
-
getSpecification
public java.lang.String getSpecification()
- Specified by:
getSpecificationin interfaceLocation- Returns:
- spec.
-
open
public void open() throws java.io.IOExceptionopen the location.
-
read
public int read(java.nio.ByteBuffer buffer) throws java.io.IOException
-
read
public int read(byte[] buffer) throws java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfaceLocation- Returns:
- the resulting input stream.
- Throws:
java.io.IOException- in case of an error.
-
-