Package org.apache.camel.component.file
Class GenericFile<T>
java.lang.Object
org.apache.camel.component.file.GenericFile<T>
- All Implemented Interfaces:
org.apache.camel.WrappedFile<T>
Generic File. Specific implementations of a file based endpoint need to provide a File for transfer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindToExchange(org.apache.camel.Exchange exchange) Bind this GenericFile to an ExchangevoidbindToExchange(org.apache.camel.Exchange exchange, boolean isProbeContentTypeFromEndpoint) Bind this GenericFile to an ExchangevoidchangeFileName(String newName) Changes the name of this remote file.voidcopyFrom(GenericFile<T> source, GenericFile<T> result) Creates a copy based on the sourcevoidcopyFromPopulateAdditional(GenericFile<T> source, GenericFile<T> result) Copies additional information from the source to the result.getBody()getFile()longcharlongbooleanprotected booleanisAbsolute(String name) booleanprotected StringnormalizePath(String name) protected StringFixes the path separator to be according to the protocolvoidpopulateHeaders(GenericFileMessage<T> message, boolean isProbeContentTypeFromEndpoint) Populates theGenericFileMessagerelevant headersvoidsetAbsolute(boolean absolute) voidsetAbsoluteFilePath(String absoluteFilePath) voidsetBinding(GenericFileBinding<T> binding) voidvoidsetCharset(String charset) voidsetCopyFromAbsoluteFilePath(String copyFromAbsoluteFilePath) voidsetDirectory(boolean directory) voidsetEndpointPath(String endpointPath) voidsetExtendedAttributes(Map<String, Object> extendedAttributes) voidvoidsetFileLength(long fileLength) voidsetFileName(String fileName) voidsetFileNameOnly(String fileNameOnly) voidsetLastModified(long lastModified) voidsetRelativeFilePath(String relativeFilePath) toString()voidupdateLastOffsetValue(Long offset)
-
Constructor Details
-
GenericFile
public GenericFile() -
GenericFile
public GenericFile(boolean probeContentType)
-
-
Method Details
-
getFileSeparator
public char getFileSeparator() -
copyFrom
Creates a copy based on the source- Parameters:
source- the sourceresult- the result
-
copyFromPopulateAdditional
Copies additional information from the source to the result. Inherited classes can override this method and copy their specific data.- Parameters:
source- the sourceresult- the result
-
bindToExchange
public void bindToExchange(org.apache.camel.Exchange exchange) Bind this GenericFile to an Exchange -
bindToExchange
public void bindToExchange(org.apache.camel.Exchange exchange, boolean isProbeContentTypeFromEndpoint) Bind this GenericFile to an Exchange -
populateHeaders
Populates theGenericFileMessagerelevant headers- Parameters:
message- the message to populate with headers
-
isAbsolute
-
normalizePath
-
changeFileName
Changes the name of this remote file. This method alters the absolute and relative names as well.- Parameters:
newName- the new name
-
getRelativeFilePath
-
setRelativeFilePath
-
getFileName
-
setFileName
-
getFileLength
public long getFileLength() -
setFileLength
public void setFileLength(long fileLength) -
getLastModified
public long getLastModified() -
setLastModified
public void setLastModified(long lastModified) -
getCharset
-
setCharset
-
getExtendedAttributes
-
setExtendedAttributes
-
getFile
- Specified by:
getFilein interfaceorg.apache.camel.WrappedFile<T>
-
setFile
-
getBody
- Specified by:
getBodyin interfaceorg.apache.camel.WrappedFile<T>
-
setBody
-
getParent
-
getBinding
-
setBinding
-
setAbsoluteFilePath
-
getAbsoluteFilePath
-
isAbsolute
public boolean isAbsolute() -
setAbsolute
public void setAbsolute(boolean absolute) -
getEndpointPath
-
setEndpointPath
-
getFileNameOnly
-
setFileNameOnly
-
isDirectory
public boolean isDirectory() -
setDirectory
public void setDirectory(boolean directory) -
getCopyFromAbsoluteFilePath
-
setCopyFromAbsoluteFilePath
-
updateLastOffsetValue
-
getLastOffsetValue
-
normalizePathToProtocol
Fixes the path separator to be according to the protocol -
toString
-