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 TypeMethodDescriptionvoid
bindToExchange
(org.apache.camel.Exchange exchange) Bind this GenericFile to an Exchangevoid
bindToExchange
(org.apache.camel.Exchange exchange, boolean isProbeContentTypeFromEndpoint) Bind this GenericFile to an Exchangevoid
changeFileName
(String newName) Changes the name of this remote file.void
copyFrom
(GenericFile source, GenericFile result) Creates a copy based on the sourcevoid
copyFromPopulateAdditional
(GenericFile<T> source, GenericFile<T> result) Copies additional information from the source to the result.getBody()
getFile()
long
char
long
boolean
protected boolean
isAbsolute
(String name) boolean
protected String
normalizePath
(String name) protected String
Fixes the path separator to be according to the protocolvoid
populateHeaders
(GenericFileMessage<T> message, boolean isProbeContentTypeFromEndpoint) Populates theGenericFileMessage
relevant headersvoid
setAbsolute
(boolean absolute) void
setAbsoluteFilePath
(String absoluteFilePath) void
setBinding
(GenericFileBinding<T> binding) void
void
setCharset
(String charset) void
setCopyFromAbsoluteFilePath
(String copyFromAbsoluteFilePath) void
setDirectory
(boolean directory) void
setEndpointPath
(String endpointPath) void
setExtendedAttributes
(Map<String, Object> extendedAttributes) void
void
setFileLength
(long fileLength) void
setFileName
(String fileName) void
setFileNameOnly
(String fileNameOnly) void
setLastModified
(long lastModified) void
setRelativeFilePath
(String relativeFilePath) toString()
void
updateLastOffsetValue
(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 theGenericFileMessage
relevant 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:
getFile
in interfaceorg.apache.camel.WrappedFile<T>
-
setFile
-
getBody
- Specified by:
getBody
in 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
-