org.apache.maven.shared.io.location
Class FileLocation

java.lang.Object
  extended by 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


Field Summary
private  java.nio.channels.FileChannel channel
           
private  java.io.File file
           
private  java.lang.String specification
           
private  java.io.FileInputStream stream
           
 
Constructor Summary
  FileLocation(java.io.File file, java.lang.String specification)
           
protected FileLocation(java.lang.String specification)
           
 
Method Summary
 void close()
           
 java.io.File getFile()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getSpecification()
           
protected  void initFile()
           
 void open()
           
 int read(byte[] buffer)
           
 int read(java.nio.ByteBuffer buffer)
           
protected  void setFile(java.io.File file)
           
protected  java.io.File unsafeGetFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private java.io.File file

channel

private java.nio.channels.FileChannel channel

specification

private final java.lang.String specification

stream

private java.io.FileInputStream stream
Constructor Detail

FileLocation

public FileLocation(java.io.File file,
                    java.lang.String specification)

FileLocation

protected FileLocation(java.lang.String specification)
Method Detail

close

public void close()
Specified by:
close in interface Location

getFile

public java.io.File getFile()
                     throws java.io.IOException
Specified by:
getFile in interface Location
Throws:
java.io.IOException

unsafeGetFile

protected java.io.File unsafeGetFile()

initFile

protected void initFile()
                 throws java.io.IOException
Throws:
java.io.IOException

setFile

protected void setFile(java.io.File file)

getSpecification

public java.lang.String getSpecification()
Specified by:
getSpecification in interface Location

open

public void open()
          throws java.io.IOException
Specified by:
open in interface Location
Throws:
java.io.IOException

read

public int read(java.nio.ByteBuffer buffer)
         throws java.io.IOException
Specified by:
read in interface Location
Throws:
java.io.IOException

read

public int read(byte[] buffer)
         throws java.io.IOException
Specified by:
read in interface Location
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface Location
Throws:
java.io.IOException