public class GenericFile<T> extends Object implements WrappedFile<T>
Constructor and Description |
---|
GenericFile() |
GenericFile(boolean probeContentType) |
Modifier and Type | Method and Description |
---|---|
void |
bindToExchange(Exchange exchange)
Bind this GenericFile to an Exchange
|
void |
bindToExchange(Exchange exchange,
boolean isProbeContentTypeFromEndpoint)
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
|
void |
copyFromPopulateAdditional(GenericFile<T> source,
GenericFile<T> result)
Copies additional information from the source to the result.
|
String |
getAbsoluteFilePath() |
GenericFileBinding<T> |
getBinding() |
Object |
getBody()
Gets the content of the file.
|
String |
getCharset() |
String |
getCopyFromAbsoluteFilePath() |
String |
getEndpointPath() |
Map<String,Object> |
getExtendedAttributes() |
T |
getFile()
Gets the file.
|
long |
getFileLength() |
String |
getFileName() |
String |
getFileNameOnly() |
char |
getFileSeparator() |
long |
getLastModified() |
String |
getParent() |
String |
getRelativeFilePath() |
boolean |
isAbsolute() |
protected boolean |
isAbsolute(String name) |
boolean |
isDirectory() |
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,
boolean isProbeContentTypeFromEndpoint)
Populates the
GenericFileMessage relevant headers |
void |
setAbsolute(boolean absolute) |
void |
setAbsoluteFilePath(String absoluteFilePath) |
void |
setBinding(GenericFileBinding<T> binding) |
void |
setBody(Object os) |
void |
setCharset(String charset) |
void |
setCopyFromAbsoluteFilePath(String copyFromAbsoluteFilePath) |
void |
setDirectory(boolean directory) |
void |
setEndpointPath(String endpointPath) |
void |
setExtendedAttributes(Map<String,Object> extendedAttributes) |
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() |
public GenericFile()
public GenericFile(boolean probeContentType)
public char getFileSeparator()
public GenericFile<T> copyFrom(GenericFile<T> source)
source
- the sourcepublic void copyFromPopulateAdditional(GenericFile<T> source, GenericFile<T> result)
source
- the sourceresult
- the resultpublic void bindToExchange(Exchange exchange)
public void bindToExchange(Exchange exchange, boolean isProbeContentTypeFromEndpoint)
public void populateHeaders(GenericFileMessage<T> message, boolean isProbeContentTypeFromEndpoint)
GenericFileMessage
relevant headersmessage
- the message to populate with headersprotected boolean isAbsolute(String name)
protected String normalizePath(String name)
public void changeFileName(String newName)
newName
- the new namepublic String getRelativeFilePath()
public void setRelativeFilePath(String relativeFilePath)
public String getFileName()
public void setFileName(String fileName)
public long getFileLength()
public void setFileLength(long fileLength)
public long getLastModified()
public void setLastModified(long lastModified)
public String getCharset()
public void setCharset(String charset)
public Map<String,Object> getExtendedAttributes()
public void setExtendedAttributes(Map<String,Object> extendedAttributes)
public T getFile()
WrappedFile
getFile
in interface WrappedFile<T>
public Object getBody()
WrappedFile
getBody
in interface WrappedFile<T>
public GenericFileBinding<T> getBinding()
public void setBinding(GenericFileBinding<T> binding)
public void setAbsoluteFilePath(String absoluteFilePath)
public String getAbsoluteFilePath()
public boolean isAbsolute()
public void setAbsolute(boolean absolute)
public String getEndpointPath()
public void setEndpointPath(String endpointPath)
public String getFileNameOnly()
public void setFileNameOnly(String fileNameOnly)
public boolean isDirectory()
public void setDirectory(boolean directory)
public String getCopyFromAbsoluteFilePath()
public void setCopyFromAbsoluteFilePath(String copyFromAbsoluteFilePath)
protected String normalizePathToProtocol(String path)
Apache Camel