RE: Commons Configuration 1.7

2010-11-17 Thread Jörg Schaible
Hi Patel,

Patel, Ronak Avinash (US SSA) wrote:

 Any ideas when VFS will be released? I was under the impression that it
 was all patched and ready to go...

It's actively worked on. Since it was not binary compatible to the last 
version and it is the first major release since years, we decided to raise 
the minimum JDK requirement to Java 5 and work over the API to reflect the 
current state of technique. Follow the conversation on the dev list to see 
the current state. Nevertheless this will raise some questions about the 
impact for Commons Configuration ...

- Jörg


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Can HTTP Commons API manage SSL certificates?

2010-11-17 Thread Moley Harey
Hi folks,

I have a some web services installed in Tomcat which must be accessed using
HTTPS protocol and I was wondering if it is possible to use Apache Http
Commons API for that, I have used this library for simple HTTP requests and
works well.

My main concern is regarding the SSL certificates, I have a self generated
certificate using keystore tool and the client should automatically accept
that certificate every time an HTTPS is done. Can I do that with Http
Commons API? How can I do that?

Thanks in advance,

Mh


Re: Can HTTP Commons API manage SSL certificates?

2010-11-17 Thread sebb
On 17 November 2010 08:42, Moley Harey moleyha...@gmail.com wrote:
 Hi folks,

 I have a some web services installed in Tomcat which must be accessed using
 HTTPS protocol and I was wondering if it is possible to use Apache Http
 Commons API for that, I have used this library for simple HTTP requests and
 works well.

 My main concern is regarding the SSL certificates, I have a self generated
 certificate using keystore tool and the client should automatically accept
 that certificate every time an HTTPS is done. Can I do that with Http
 Commons API? How can I do that?

The Commons HttpClient project used to be a part of Commons, but is
now part of Apache HttpComponents [1]

[1] http://hc.apache.org/

 Thanks in advance,

 Mh


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Commons Configuration 1.7

2010-11-17 Thread Ralph Goers

On Nov 17, 2010, at 12:31 AM, Jörg Schaible wrote:

 Hi Patel,
 
 Patel, Ronak Avinash (US SSA) wrote:
 
 Any ideas when VFS will be released? I was under the impression that it
 was all patched and ready to go...
 
 It's actively worked on. Since it was not binary compatible to the last 
 version and it is the first major release since years, we decided to raise 
 the minimum JDK requirement to Java 5 and work over the API to reflect the 
 current state of technique. Follow the conversation on the dev list to see 
 the current state. Nevertheless this will raise some questions about the 
 impact for Commons Configuration ...
 

I'm not sure what you mean Jorg. VFS is an optional dependency so the Java 5 
requirement isn't an issue (although the doc probably needs to be updated) and 
none of the changes made to VFS of late have had much of an impact on 
Configuration.  I've checked several times.

Ralph


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Net] problem in FTP file retrieving

2010-11-17 Thread Pablo Pinto
Hi,

I think you need to add the following after retrieveFile:

ftpClient.completePendingCommand();

Best Regards,
Pablo

2010/11/17 Francesco Fazzini ffrancesc...@gmail.com

 Hello,

 I am using commons-net version 2.0. I need to retrieve more than one
 file using the same FTP connection.
 I tried with 2 different API: boolean retrieveFile(String remote,
 OutputStream local), InputStream retrieveFileStream(String remote) on more
 than one FTP server(so it is reproducible from my side)
 only the first works correctly(I took a look to the library source code,
 they should have a different implementation)...

 The question is: What is missing in my code in order that both could work
 correctly? Do I have to manage something else? Is something wrong?

 //WORKS WELL

 //OUTPUT
 15-11-2010 13:12:20 INFO - anonymous
 15-11-2010 13:12:20 INFO -
 15-11-2010 13:12:20 INFO - login succesful... true
 15-11-2010 13:12:20 INFO - 230 User anonymous logged in.
 15-11-2010 13:12:20 INFO - 230 User anonymous logged in.
 now downloading...first file
 15-11-2010 13:12:23 INFO - 226 Transfer complete.
 now downloading...second file
 15-11-2010 13:12:25 INFO - 226 Transfer complete.
 now downloading...third file
 15-11-2010 13:12:28 INFO - 226 Transfer complete.
 now downloading...fourth file
 15-11-2010 13:12:30 INFO - 226 Transfer complete.
 now downloading...fifth file
 15-11-2010 13:12:33 INFO - 226 Transfer complete.

 // snippet code used
  OutputStream outputStream = null;
  try{
   ftpClient.enterLocalPassiveMode();
   logger.info(ftpClient.getReplyString());
   //String remoteFile = UriUtil.getRemoteFilePathFromUri(uri);
   outputStream = new FileOutputStream(newLocalFilePath);
   for(String remoteFilePath : remoteFilePaths){
System.out.println(now downloading...  + remoteFilePath);
 ftpClient.retrieveFile(remoteFilePath,outputStream);
logger.info(ftpClient.getReplyString());
   }
  }
  finally {
   outputStream.close();
  }


 //DOESN' T WORK

 //OUTPUT

 15-11-2010 13:41:25 INFO - anonymous
 15-11-2010 13:41:25 INFO -
 15-11-2010 13:41:26 INFO - login succesful... true
 15-11-2010 13:41:26 INFO - 230 User anonymous logged in.
 15-11-2010 13:41:26 INFO - 230 User anonymous logged in.
 now downloading... first file
 15-11-2010 13:41:26 INFO - 150 Opening ASCII mode data connection for
 /goldenPath/hg18/UCSCGenes/uniProtToUcscGenes.txt (1007617 bytes)
 now downloading...second file
 15-11-2010 13:41:29 INFO - 226 Transfer complete.
 now downloading... third file
 15-11-2010 13:41:29 ERROR - Connection refused
 java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.init(Socket.java:375)
at java.net.Socket.init(Socket.java:189)
at
 javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:206)
at

 org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:502)
at

 org.apache.commons.net.ftp.FTPClient.retrieveFileStream(FTPClient.java:1333)


 //code snippet used

 InputStream inputStream = null;
  OutputStream outputStream = null;
  try{
   ftpClient.enterLocalPassiveMode();
   logger.info(ftpClient.getReplyString());
   //String remoteFile = UriUtil.getRemoteFilePathFromUri(uri);
   outputStream = new FileOutputStream(newLocalFilePath);
   for(String remoteFilePath : remoteFilePaths){
System.out.println(now downloading...  + remoteFilePath);
inputStream = ftpClient.retrieveFileStream(remoteFilePath);
logger.info(ftpClient.getReplyString());
if(inputStream != null){
 isDownloaded=true;
 int bytesRead = -1;
 final byte[] buffer = new byte[4096];
 while ((bytesRead = inputStream.read(buffer)) != -1) {
  outputStream.write(buffer, 0, bytesRead);
 }
 inputStream.close();
}
   }
  }
  finally {
   outputStream.close();
  }


 Thanks in advance.

 Best regards,
 Francesco




-- 
Pablo Pinto
Computación y Comunicaciones S.A.
Almirante Lorenzo Gotuzzo 124, Oficina 1500
Teléfonos : 9135704 - 9135700


Re: [scxml] Need for JSF

2010-11-17 Thread niklas modin

 Hi,

Looking at the manifest for scxml, it seems like all optional maven 
dependencies along
with the required ones, all gets translated into an entry under the 
Import-Package: part.


AFAIK, I don't think there is a notion for optional dependency injection 
in OSGi, so I guess
that means that all dependencies are in fact required for an OSGi 
deployment.


Not sure how to proceed here, but seems that also deploying JSF and all 
transitive

dependencies is what I need to do.

Another quick Q:

Are there any plans for a 0.10 release ?

Thanks,
Niklas



On 11/16/2010 2:23 PM, Rahul Akolkar wrote:

On Tue, Nov 16, 2010 at 4:53 PM, niklas modinniklas.mo...@oracle.com  wrote:

  Hi,

I'm trying to get SC XML up and running in an equinox OSGi environment, and
I'm having some dependencies issues.

What's the reason for having a dependency to myfaces-api ? This isn't a big
issue per say I guess, but it just seems
like that drag's in a lot of dependencies, and can't really see what JSF is
used for.


snip/

You are indeed correct that most applications that use Commons SCXML
may be unrelated to JSF (and some of the other optional dependencies
as well).

Commons SCXML has three required dependencies, which are listed at the
top of this page:

   http://commons.apache.org/scxml/dependencies.html

Note that the others are optional. In addition, the JSF API is meant
to be provided (by the environment).

If the OSGi related headers in the release jar file don't reflect this
correctly, then they should.

-Rahul



Cheers,
Niklas


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [scxml] Need for JSF

2010-11-17 Thread niklas modin

 Hi again,

Looked into it a little bit more, and there is indeed a way to note 
import packages as optional,

but it seems like this isn't set properly in the manifest file.

Not sure if there is an issue with the maven assembly plugin, or if 
there is a way to instruct it  to

include the resolution:=optional parameter in the manifest file.


/Niklas



On 11/17/2010 9:46 AM, niklas modin wrote:

 Hi,

Looking at the manifest for scxml, it seems like all optional maven 
dependencies along
with the required ones, all gets translated into an entry under the 
Import-Package: part.


AFAIK, I don't think there is a notion for optional dependency 
injection in OSGi, so I guess
that means that all dependencies are in fact required for an OSGi 
deployment.


Not sure how to proceed here, but seems that also deploying JSF and 
all transitive

dependencies is what I need to do.

Another quick Q:

Are there any plans for a 0.10 release ?

Thanks,
Niklas



On 11/16/2010 2:23 PM, Rahul Akolkar wrote:
On Tue, Nov 16, 2010 at 4:53 PM, niklas 
modinniklas.mo...@oracle.com  wrote:

  Hi,

I'm trying to get SC XML up and running in an equinox OSGi 
environment, and

I'm having some dependencies issues.

What's the reason for having a dependency to myfaces-api ? This 
isn't a big

issue per say I guess, but it just seems
like that drag's in a lot of dependencies, and can't really see what 
JSF is

used for.


snip/

You are indeed correct that most applications that use Commons SCXML
may be unrelated to JSF (and some of the other optional dependencies
as well).

Commons SCXML has three required dependencies, which are listed at the
top of this page:

   http://commons.apache.org/scxml/dependencies.html

Note that the others are optional. In addition, the JSF API is meant
to be provided (by the environment).

If the OSGi related headers in the release jar file don't reflect this
correctly, then they should.

-Rahul



Cheers,
Niklas


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[vfs] replicateFile() method doesn't work for CD drives

2010-11-17 Thread Daniel
I used to cheat and use getLocalFile() method for my local files,
until I leant about File f =
file.getFileSystem().replicateFile(file,Selectors.SELECT_SELF).
But this way doesn't work for empty CD drives. Saying it does not
exist. Is there a way for it to return a File even if it does not
exist?
For now I have fallen back to getLocalFile() when this error happens.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



replicateFile method doesn't work for CD drives

2010-11-17 Thread Daniel
I been using File f =
file.getFileSystem().replicateFile(file,Selectors.SELECT_SELF) to get
the local file but this way doesn't work for empty CD drives. Saying
it does not exist. Is there a way for it to return a File even if it
does not exist?

I used to use getLocalFile() method and that sorta worked. So for now
I fall back to this.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org