org.apache.camel.component.file
Class GenericFile<T>

java.lang.Object
  extended by org.apache.camel.component.file.GenericFile<T>
All Implemented Interfaces:
Serializable

public class GenericFile<T>
extends Object
implements Serializable

Generic File. Specific implementations of a file based endpoint need to provide a File for transfer.

See Also:
Serialized Form

Constructor Summary
GenericFile()
           
 
Method Summary
 void bindToExchange(Exchange exchange)
          Bind this GenericFile to an Exchange
 void changeFileName(String newName)
          Changes the name of this remote file.
 GenericFile<T> copyFrom(GenericFile<T> source)
          Creates a copy based on the source
 String getAbsoluteFilePath()
           
 GenericFileBinding<T> getBinding()
           
 Object getBody()
           
 String getEndpointPath()
           
 T getFile()
           
 long getFileLength()
           
 String getFileName()
           
 String getFileNameOnly()
           
 char getFileSeparator()
           
 long getLastModified()
           
 String getParent()
           
 String getRelativeFilePath()
           
 boolean isAbsolute()
           
protected  boolean isAbsolute(String name)
           
protected  String normalizePath(String name)
           
protected  String normalizePathToProtocol(String path)
          Fixes the path separator to be according to the protocol
 void populateHeaders(GenericFileMessage<T> message)
          Populates the GenericFileMessage relevant headers
 void setAbsolute(boolean absolute)
           
 void setAbsoluteFilePath(String absoluteFilePath)
           
 void setBinding(GenericFileBinding<T> binding)
           
 void setBody(Object os)
           
 void setEndpointPath(String endpointPath)
           
 void setFile(T file)
           
 void setFileLength(long fileLength)
           
 void setFileName(String fileName)
           
 void setFileNameOnly(String fileNameOnly)
           
 void setLastModified(long lastModified)
           
 void setRelativeFilePath(String relativeFilePath)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GenericFile

public GenericFile()
Method Detail

getFileSeparator

public char getFileSeparator()

copyFrom

public GenericFile<T> copyFrom(GenericFile<T> source)
Creates a copy based on the source

Parameters:
source - the source
Returns:
a copy of the source

bindToExchange

public void bindToExchange(Exchange exchange)
Bind this GenericFile to an Exchange


populateHeaders

public void populateHeaders(GenericFileMessage<T> message)
Populates the GenericFileMessage relevant headers

Parameters:
message - the message to populate with headers

isAbsolute

protected boolean isAbsolute(String name)

normalizePath

protected String normalizePath(String name)

changeFileName

public void changeFileName(String newName)
Changes the name of this remote file. This method alters the absolute and relative names as well.

Parameters:
newName - the new name

getRelativeFilePath

public String getRelativeFilePath()

setRelativeFilePath

public void setRelativeFilePath(String relativeFilePath)

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)

getFileLength

public long getFileLength()

setFileLength

public void setFileLength(long fileLength)

getLastModified

public long getLastModified()

setLastModified

public void setLastModified(long lastModified)

getFile

public T getFile()

setFile

public void setFile(T file)

getBody

public Object getBody()

setBody

public void setBody(Object os)

getParent

public String getParent()

getBinding

public GenericFileBinding<T> getBinding()

setBinding

public void setBinding(GenericFileBinding<T> binding)

setAbsoluteFilePath

public void setAbsoluteFilePath(String absoluteFilePath)

getAbsoluteFilePath

public String getAbsoluteFilePath()

isAbsolute

public boolean isAbsolute()

setAbsolute

public void setAbsolute(boolean absolute)

getEndpointPath

public String getEndpointPath()

setEndpointPath

public void setEndpointPath(String endpointPath)

getFileNameOnly

public String getFileNameOnly()

setFileNameOnly

public void setFileNameOnly(String fileNameOnly)

normalizePathToProtocol

protected String normalizePathToProtocol(String path)
Fixes the path separator to be according to the protocol


toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL