In Apache camel,if i delete a file in input directory meanwhile the same file should also be deleted in output directory automatically? am new to Apache camel please suggest me some ideas.
thank you,
That is not how the Camel file component is designed. Its not a file sync tool. You can use rsync or some other tool for that.
The Camel file component is for picking up new files in a directory. It only reacts on new files, not on files being deleted.
I think you have not read the camel documentation because as Claus Ibsen states, Cmael is not a file sync tool. You should find another tool if you have deletition to be a trigger mechanism.
Related
I want to read files everyday, so the path should be always set for current date. How can I do it in flink?
I think you can either generate the path of the file you expect to exist, and then read it, or set up a streaming job that uses file discovery to ingest files as they become available.
See the docs for the FileSource and readfile. readfile is the legacy connector for ingesting files; FileSource was introduced in Flink 1.12.
fileInputFormat.setFilesFilter(filter);
I decided to use this but not sure it is a best practice.
I have to do a query in db to get the filenames from a table. And then I have to read the contents of files in a folder/directory using the file names I got from query. I have done the query part and stored the list of filenames in Exchange using a bean. But I am wondering how can I use this filenames in exchange to read the file contents. Could you please help?
You can use the pattern Content Enricher (http://camel.apache.org/content-enricher.html) and Camel 2.16 with dynamic endpoints to load the contents of a file, by path previously obtained from the database.
UPDATED
You have to use the pollEnrich (because file component is a polling consumer) to consume files from uri and you can use an expression (such as Simple) to configure the fileName.
You can try something like that (only for Camel version greater than 2.16):
.pollEnrich("file:?fileName=${header.FILE_NAME}", 1000, new YourAggregationStrategy())
I currently use Globalscapes CuteFTP as my FTP client and am in the process of cleaning up old, unused files. I use a script to upload new files to the FTP but that is based on a wildcard; uploading anything I have in a specific folder.
Now I want to do the opposite and delete files but only specific files. I have a list of over 1,000 file names that I need to remove (or ideally move to a designated folder) but I am not sure how to write the script to do this. Could someone help me create a batch relocate script or at least point me in the right direction?
You'll have better luck looking for some FTP client that allows scriptable actions. A quick search pointed out http://winscp.net/eng/docs/scripting which might be helpful.
I have a Lightspeed POS 3.x Backup file. I would like to abstract the database out of it. Is this at all possible? The file extension of the backup file is .lightspeedBackup.
I believe you should be able to just rename it as a .zip and extract it. Once you do you should have several directories and files with all your data in it.
Not sure why they try to hide that or are using their own extension.
I have accidentally deleted the file app/design/frontend/base/default/layout/page.xml from my directory.
My understanding is that this is the 'default' page.xml file that comes with Magento. How can I get this file back?
You can get the file from:
http://svn.magentocommerce.com/source/branches/1.7/app/design/frontend/base/default/layout/page.xml
If you have an other version of Magento, you might want to tweak with the version in the URL.
You could also redownload Magento and search for the file in the package if this won't work out.
Another way is to just go over to www.magentocommerce.com/download, select the release archive tab, grab the .zip archive for the version you are working with and unzip it into a temp folder. You then have all the files that make up Magento right there stored in the exact same directory tree as exists on your website, very easy to retrieve.
Personally, I keep the archives on hand for the current version, previous version and next version in my upgrade path. That way I always have an easy reference if some code oddity comes up in my custom templates and modules.