Class FileLocation
- java.lang.Object
-
- org.apache.maven.plugins.assembly.io.FileLocation
-
- All Implemented Interfaces:
Location
- Direct Known Subclasses:
URLLocation
class FileLocation extends java.lang.Object implements Location
file location implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.channels.FileChannelchannelprivate java.io.Filefileprivate java.lang.Stringspecificationprivate java.io.FileInputStreamstream
-
Constructor Summary
Constructors Constructor Description FileLocation(java.io.File file, java.lang.String specification)FileLocation(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)(package private) java.io.FileunsafeGetFile()
-
-
-
Method Detail
-
close
public void close()
Description copied from interface:LocationClose the location.
-
getFile
public java.io.File getFile() throws java.io.IOException
-
unsafeGetFile
java.io.File unsafeGetFile()
- Returns:
File
-
initFile
protected void initFile() throws java.io.IOExceptioninitialize file.- Throws:
java.io.IOException- in case of 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.IOExceptionDescription copied from interface:LocationOpen 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
-
-