I used FTP component of camel but it could not download the files that I want.
<camel:endpoint id="ftpNotificationDownload" uri="sftp:/11.1.1.1://app/as?username=aa&password=1111&fastExistsCheck=true&localWorkDirectory=C:\\asd&download=true&throwExceptionOnConnectFailed=true&delay=4000&useFixedDelay=true"/>
I want all the files and folders to be downloaded under my local folder so I did not put filename option.
When I give the host name as 11.1.1.1, it works but when I set directory after host name like 11.1.1.1:/app/directory, it does not work.
I have checked SFTP server and it is up.
There should not be a colon (:) after the host name in the uri. And probably not even one of the two slashes. On the other hand, you are missing one slash after the sftp:.
See Apache Camels URIs syntax.
sftp://[username#]hostName[:port]/directoryName[?options]
Try
sftp://11.1.1.1/app/as?...
Note that this is true for any URI, not just Camel.
Related
I have searched all around and the only results I get are using wget or curl.
I would like to be able to download full directories being served on my apache server using just a URL. For example if I want to download the directory Contents, I would like to be able to do this: http://127.0.0.1/Contents. Instead, when I do this, I just get a page with all the files inside it instead of actually downloading the directory.
Is it because this is not possible? Or because i just need to configure it in apache2.conf ?
Worked it out, in order to download a folder/directory from a URL, compress the folder into a .zip file or anything similar to .zip, then call it in the URL: http://127.0.0.1/yourfolder.zip
I have an Apache Camel route that listens for an FTP server to process files. The problem is that I need to change permission of the file across the FTP server, so I tried to add chmod option included in the documentation for Apache Camel SFTP Component, but it didn't change the permissions of the file so the processing fails in the last step not matter if it finished ok or not. All of this works locally but didn't work deployed on Openshift.
I am using the chmod option as follows:
sftp://AAAA#BBBB/PATH/TO/procesado?password=XXXX&maxMessagesPerPoll=15&delay=30000&fileName=${header.CamelFileName}&chmod=755
Can someone tell me why it doesn't work on Openshift, or if there is a way to make it work.
The Apache Camel File component not working properly in Windows7, where as its working in Linux without any Problem.
My Requirement:
After the file processing, the files must be deleted from the Directory. In Windows, because of .camelLock the files are not deleting properly.
After Multiple attempts, then only Apache camel can delete the file from the Directory. If the attemt failed to delete the file from the Directory then its throwing an exception.
If I have only a File in the Directory, it's working without any Problem, but if i have multiple Files then it's throwing an Exception.
Application Environment:
I deployed the Apache camel application in Tomcat Server.
Apache Camel version: 2.17.1
Apache Camel Route:
<from uri="file:///var/opt/irs/message?delete=true" />
<to uri="direct:file.storage.original" />
In Windows I am receiving following Error:
1|2017-11-14 17:56:34,828|11-01-41|default|WARN
|yes||o.a.c.c.f.GenericFileOnCompletion|file.analysis.input|Error
during commit. Exchange[ID-51741-1510678404569-9-22]. Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot delete file: GenericFile[C:\var\opt\irs\message\661.zip]]
org.apache.camel.component.file.GenericFileOperationFailedException:
Cannot delete file: GenericFile[C:\var\opt\irs\message\661.zip] at
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.commit(GenericFileDeleteProcessStrategy.java:89)
at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:127)
Similar Problems:
Camel 2.15 file locks ,
Camel 2.14.2 not deleting files on Windows ,deleting moving files
In this case, I forgot to close file input stream. so that's why I had a problem in Windows.
I am using InputStream unnecessarily for the Filecomponent. I removed it, everything working file.
InputStream input = CamelContextHelper.convertTo(context, InputStream.class, body);
If anybody has same problem, just close the file InputStream properly or Cross-check your code and try to replace it with other proper alternative solution.
Alternative Solution:
In case,if you are unable to find open streams in your code, then apply below parameters to Apache camel route. The performance would be better.
readLockCheckInterval=1&readLockTimeout=3
In my case Performance much better in windows.
I'm developing a website and having development environment as Ubuntu 14.04, PHP 5.5.9, Apache 2.4.7. My issue is if some want accessing a file like http://domain.com/robots(without extension) then I should avoid but I've to allow if some tries to access http://domain.com/robots.txt(with extension).
Now in both ways I'm able to access files, I want to avoid this when user haven't given extension of the file using .htaccess or apache configuration file.
My previous environment was Apache 2.2 and PHP 5.3.10 at the time with default Apache configuration it was working as expected but after upgrade its not working as expected and due lack of knowledge on Apache configuration I'm unable to pick those lines of code.
Add following line in .htaccess
Options -Multiviews
I'm having trouble finding documentation regarding this. After some googling I find that bin, conf,logs, temp, webapps, work are directories that should exist in CATALINA_BASE.
temp, logs, webapps, bin and work I don't have any trouble understanding.
bin I suppose is just another bin folder, if for some reason both CATALINA_HOME and CATALINA_BASE are in PATH, then scripts in both folders will be available for execution.
But how about conf? Will the content of CATALINA_HOME/conf be totally ignored if CATALINA_BASE is set? Suppose I only would need to customize only a few config files pr. CATALINA_BASE, would I still need to keep a complete set of config files in CATALINA_BASE/conf, or could the standard config files in CATALINA_HOME/conf be shared?
And ditto for CATALINA_BASE/lib ... would this work as a "global" lib folder pr. instance?
You can find the answer in the Tomcat documentation:
http://tomcat.apache.org/tomcat-6.0-doc/RUNNING.txt
Advanced Configuration - Multiple Tomcat Instances
In many circumstances, it is desirable to have a single copy of a
Tomcat binary distribution shared among multiple users on the same
server. To make this possible, you can set the $CATALINA_BASE
environment variable to the directory that contains the files for your
'personal' Tomcat instance.
When you use $CATALINA_BASE, Tomcat will calculate all relative
references for files in the following directories based on the value
of $CATALINA_BASE instead of $CATALINA_HOME:
bin - Only setenv.sh (*nix), setenv.bat (windows) and tomcat-juli.jar
conf - Server configuration files (including server.xml)
logs - Log and output files
webapps - Automatically loaded web applications
work - Temporary working directories for web applications
temp - Directory used by the JVM for temporary files (java.io.tmpdir)
Note that by default Tomcat will first try to load classes and JARs
from $CATALINA_BASE/lib and then $CATALINA_HOME/lib. You can place
instance specific JARs and classes (e.g. JDBC drivers) in
$CATALINA_BASE/lib whilst keeping the standard Tomcat JARs in
$CATALINA_HOME/lib.
If you do not set $CATALINA_BASE, $CATALINA_BASE will default to the
same value as $CATALINA_HOME, which means that the same directory is
used for all relative path resolutions.