Re: How can I get Commons-net-2.1 Source and Binaries
陳雪傑 wrote: Hi all How can I get Commons-net-2.1 Source and Binaries? I want get publiced Commons-net-2.1 Source and Binaries from apache, but the page (http://commons.apache.org/net/download_net.cgi) do not provide it. You cannot, since it was never officially released. So, yes, there is a tag in Subversion, but nobody knows, who spread it into public, what it actually contains and you're on your own using this code. Therefore you cannot download any binaries or tar balls, it has no direct support here. Actually you should use version 2.0 until we release the next version which will be 2.2. - Jörg - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
RE: How can I get Commons-net-2.1 Source and Binaries
Hi Jörg You cannot, since it was never officially released. So, yes, there is a tag in Subversion, but nobody knows, who spread it into public, what it actually contains and you're on your own using this code. Therefore you cannot download any binaries or tar balls, it has no direct support here. Actually you should use version 2.0 until we release the next version which will be 2.2. Do you know the version 2.2 release date? Thanks - 陳雪傑 -Original Message- From: Jörg Schaible [mailto:joerg.schai...@gmx.de] Sent: Thursday, October 14, 2010 3:36 PM To: user@commons.apache.org Subject: Re: How can I get Commons-net-2.1 Source and Binaries 陳雪傑 wrote: Hi all How can I get Commons-net-2.1 Source and Binaries? I want get publiced Commons-net-2.1 Source and Binaries from apache, but the page (http://commons.apache.org/net/download_net.cgi) do not provide it. You cannot, since it was never officially released. So, yes, there is a tag in Subversion, but nobody knows, who spread it into public, what it actually contains and you're on your own using this code. Therefore you cannot download any binaries or tar balls, it has no direct support here. Actually you should use version 2.0 until we release the next version which will be 2.2. - Jörg - 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: How can I get Commons-net-2.1 Source and Binaries
Why does the site list it in the release notes? Do we need to move all of the jira issues to 2.2? On Oct 14, 2010 3:36 AM, Jörg Schaible joerg.schai...@gmx.de wrote: 陳雪傑 wrote: Hi all How can I get Commons-net-2.1 Source and Binaries? I want get publiced Commons-net-2.1 Source and Binaries from apache, but the page (http://commons.apache.org/net/download_net.cgi) do not provide it. You cannot, since it was never officially released. So, yes, there is a tag in Subversion, but nobody knows, who spread it into public, what it actually contains and you're on your own using this code. Therefore you cannot download any binaries or tar balls, it has no direct support here. Actually you should use version 2.0 until we release the next version which will be 2.2. - Jörg - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [Fileupload] Missing character in the middle of a file
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 10/12/2010 5:15 PM, Brian Pontarelli wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 10/4/2010 11:43 AM, Brian Pontarelli wrote: I figured that the original File and the File written out by the FileUpload would have different bytes at the start or end and it was my mock input stream that was causing the issue. To test this theory I opened both files in a HEX editor. What I found was that the files differ by one a single byte and that byte is at position 305. The other interesting thing I found was that the byte that exists in the original and is missing from the FileUpload file is 'FF'. That's weird. Is the missing byte always at position 305? What variety of test files have you tried? Is it always 0xff that gets discarded? Could you post some of your test driver code, and some of the servlet code so we can see how they interact? I'm back from my travels and wanted to circle back on this thread. There is quite a bit of code for all of this stuff, but I'll post some of it. I'm going to post the code we use to create the multipart request and some unit test code we use to test it all: Your MultipartInputStream looks good to me at first reading. I forgot how verbose multipart messages were :) Can you dump your ByteArrayOutputStream after building it, just to see if the message it will (ultimately) send it legit? What is the CLOSE_BOUNDARY being used for? I don't believe you need that at the end of your stream. Also, where does the part of the message come from that has Content-Type: multipart/form-data? Is that external? Have you compared the message you send to your test server with, for instance, the message that a web browser such as Firefox will send? @Override public int available() throws IOException { return bytes.length; } This might not be correct, although it likely does not have an effect on your code. public int read() throws IOException { if (index == bytes.length) { return -1; } return bytes[index++]; } I might check for index = bytes.length, though it also shouldn't be a problem: you'd be getting an ArrayIndexOutOfBoundsException if this were a problem. byte[] orig = read(new File(src/java/test/unit/org/jcatapult/servlet/test.jar)); byte[] read = read(file); assertEquals(orig.length, read.length); So, the above call fails because the files are 1 byte different? for (int i = 0; i orig.length; i++) { assertEquals(Byte at index + i + was invalid, orig[i], read[i]); } Without the length check, you get invalid starting at index 301 and continuing to the end of the file? I have to ask again: Is the missing byte always at position 305? What variety of test files have you tried? Is it always 0xff that gets discarded? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAky3KXEACgkQ9CaO5/Lv0PDBgACdHISg3Apuy7dLsNptoZezKkaj uUoAoK4Jr/Pyxz8Iwf8jjlvSIBVc/O0I =Fr5w -END PGP SIGNATURE- - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
[Math] Exponential curve fitting problem
Hi, I am reposting this issue since the original one through nabble forums somehow didn't get accepted, so I am hoping this one is;-) I am currently evaluating whether commons Math can be used in our project for regression analysis. Based on an earlier thread I've tried to apply natural exponential curve fitting: http://apache-commons.680414.n4.nabble.com/MATH-Need-help-on-math-libraries-for-curve-generation-td1050024.html#a1050024 The results are not really promising. If I generate y values for this function: y = 20 + 10*e^(2*x) the result is: y = 1.040425114042751E13 + 21.13 * e^(1.7x) RMS:2.895606396069334E25 which isn't a good fit. Any ideas if and how this can be improved? initialGuess = new double[] {1,1,1}; Exp function is like this: public class NaturalExp2D implements ParametricRealFunction { @Override public double value(double x, double[] coeffs) throws FunctionEvaluationException { double a = coeffs[0]; double b = coeffs[1]; double c = coeffs[2]; double value = a + b*Math.exp(c * x); return value; } @Override public double[] gradient(double x, double[] coeffs) throws FunctionEvaluationException { double[] gradient = new double[3]; double a = coeffs[0]; double b = coeffs[1]; double c = coeffs[2]; gradient[0] = 1.0; // this is dy/da final double exp = Math.exp(c * x); gradient[1] = exp; // this is dy/db gradient[2] = b * x * exp; // this is dy/dc return gradient; } } Generated data: point: 1.0 - 93.89056099 function: 1.0404251140543246E13 point: 2.0 - 565.9815003 function: 1.0404251141061297E13 point: 3.0 - 4054.287935 function: 1.0404251143898256E13 point: 4.0 - 29829.57987 function: 1.0404251159434023E13 point: 5.0 - 220284.6579 function: 1.04042512445E13 point: 6.0 - 1627567.914 function: 1.0404251710410879E13 point: 7.0 - 1.202606284E7 function: 1.0404254261774613E13 point: 8.0 - 8.886112521E7 function: 1.0404268233571447E13 point: 9.0 - 6.565997114E8 function: 1.040434474602795E13 point: 10.0 - 4.851651974E9 function: 1.040476374410452E13 point: 11.0 - 3.5849128481E10 function: 1.0407058264450576E13 point: 12.0 - 2.64891E11 function: 1.0419623533631664E13 point: 13.0 - 1.9573E12 function: 1.0488433553061055E13 point: 14.0 - 1.44626E13 function: 1.086525148713279E13 point: 15.0 - 1.06865E14 function: 1.292878462686391E13 point: 16.0 - 7.8963E14 function: 2.4229119971194812E13 point: 17.0 - 5.83462E15 function: 8.611209942795956E13 point: 18.0 - 4.31123E16 function: 4.249961262960237E14 point: 19.0 - 3.18559E17 function: 2.2807953246289075E15 point: 20.0 - 2.35385E18 function: 1.2443536532475274E16 point: 21.0 - 1.73927E19 function: 6.8096814619047912E16 point: 22.0 - 1.28516E20 function: 3.7286570506270682E17 point: 23.0 - 9.49612E20 function: 2.04184334260224461E18 point: 24.0 - 7.01674E21 function: 1.1181510946313906E19 point: 25.0 - 5.18471E22 function: 6.123222584353946E19 point: 26.0 - 3.83101E23 function: 3.353203185774627E20 point: 27.0 - 2.83075E24 function: 1.8362835462312472E21 point: 28.0 - 2.09166E25 function: 1.0055869403818766E22 point: 29.0 - 1.54554E26 function: 5.506802588140335E22 kind regards, Christiaan -- View this message in context: http://apache-commons.680414.n4.nabble.com/Math-Exponential-curve-fitting-problem-tp2995629p2995629.html Sent from the Commons - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [Math] Exponential curve fitting problem
Using a single error measure for a wide range of functions doesn't work well (as you have noted). The fundamental problem is that squared error is a *really* bad metric on curves like this. If you plot your original function and the fitted version, you will see what the issue is. I took, for instance, data with x = 1:20. Your fitted function fits the first 17 data points very well and fits the last 3 data points progressively more poorly. To fix this, the fitting routine has to change the exponent by 0.3 and the intercept by 10^13. This means that you are trying to search *really* narrow valley in your parameter space and it isn't surprising that the optimizer is having some problems. It is probably much more fruitful to recast your entire framework into something like generalized linear modeling. This will give you much better conditioned problems that avoid your current issue. In R, for instance, the following sequence fits your curve very nicely. The same algorithm applied in commons math would work just as well. data = data.frame(x=1:20, y= ( 20 + 10*exp(2*1:20))) plot(y~x, data) glm(log(y)~x, data, family=gaussian) Call: glm(formula = log(y) ~ x, family = gaussian, data = data, start = c(1, 1)) Coefficients: (Intercept) x 2.3580706246 1.9960549114 Degrees of Freedom: 19 Total (i.e. Null); 18 Residual Null Deviance:2649.5608104 Residual Deviance: 0.044396172588 AIC: -59.449144468 m=glm(log(y)~x, data, family=gaussian, start=c(1,1)) summary(m) Call: glm(formula = log(y) ~ x, family = gaussian, data = data, start = c(1, 1)) Deviance Residuals: Min1QMedian3Q Max -0.0390344769970 -0.0249105105363 -0.0098817616272 0.0086221578383 0.1880043231948 Coefficients: Estimate Std. Errort value Pr(|t|) (Intercept) 2.3580706246025 0.0230702149442 102.21277 2.22e-16 *** x 1.9960549114187 0.0019258643339 1036.44627 2.22e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for gaussian family taken to be 0.0024664540326436) Null deviance: 2.64956081042e+03 on 19 degrees of freedom Residual deviance: 4.43961725876e-02 on 18 degrees of freedom AIC: -59.4491444677 Number of Fisher Scoring iterations: 2 lines(data$x, exp(predict(m))) On Thu, Oct 14, 2010 at 9:16 AM, Christiaan christiaan...@hotmail.comwrote: Hi, I am reposting this issue since the original one through nabble forums somehow didn't get accepted, so I am hoping this one is;-) I am currently evaluating whether commons Math can be used in our project for regression analysis. Based on an earlier thread I've tried to apply natural exponential curve fitting: http://apache-commons.680414.n4.nabble.com/MATH-Need-help-on-math-libraries-for-curve-generation-td1050024.html#a1050024 The results are not really promising. If I generate y values for this function: y = 20 + 10*e^(2*x) the result is: y = 1.040425114042751E13 + 21.13 * e^(1.7x) RMS:2.895606396069334E25 which isn't a good fit. Any ideas if and how this can be improved?
Re: [Math] Exponential curve fitting problem
the problem is not with fitting, but with a scale of your y: E13 to E22 get the log, and it may work better then. On Thu, Oct 14, 2010 at 12:16 PM, Christiaan christiaan...@hotmail.comwrote: Hi, I am reposting this issue since the original one through nabble forums somehow didn't get accepted, so I am hoping this one is;-) I am currently evaluating whether commons Math can be used in our project for regression analysis. Based on an earlier thread I've tried to apply natural exponential curve fitting: http://apache-commons.680414.n4.nabble.com/MATH-Need-help-on-math-libraries-for-curve-generation-td1050024.html#a1050024 The results are not really promising. If I generate y values for this function: y = 20 + 10*e^(2*x) the result is: y = 1.040425114042751E13 + 21.13 * e^(1.7x) RMS:2.895606396069334E25 which isn't a good fit. Any ideas if and how this can be improved? initialGuess = new double[] {1,1,1}; Exp function is like this: public class NaturalExp2D implements ParametricRealFunction { @Override public double value(double x, double[] coeffs) throws FunctionEvaluationException { double a = coeffs[0]; double b = coeffs[1]; double c = coeffs[2]; double value = a + b*Math.exp(c * x); return value; } @Override public double[] gradient(double x, double[] coeffs) throws FunctionEvaluationException { double[] gradient = new double[3]; double a = coeffs[0]; double b = coeffs[1]; double c = coeffs[2]; gradient[0] = 1.0; // this is dy/da final double exp = Math.exp(c * x); gradient[1] = exp; // this is dy/db gradient[2] = b * x * exp; // this is dy/dc return gradient; } } Generated data: point: 1.0 - 93.89056099 function: 1.0404251140543246E13 point: 2.0 - 565.9815003 function: 1.0404251141061297E13 point: 3.0 - 4054.287935 function: 1.0404251143898256E13 point: 4.0 - 29829.57987 function: 1.0404251159434023E13 point: 5.0 - 220284.6579 function: 1.04042512445E13 point: 6.0 - 1627567.914 function: 1.0404251710410879E13 point: 7.0 - 1.202606284E7 function: 1.0404254261774613E13 point: 8.0 - 8.886112521E7 function: 1.0404268233571447E13 point: 9.0 - 6.565997114E8 function: 1.040434474602795E13 point: 10.0 - 4.851651974E9 function: 1.040476374410452E13 point: 11.0 - 3.5849128481E10 function: 1.0407058264450576E13 point: 12.0 - 2.64891E11 function: 1.0419623533631664E13 point: 13.0 - 1.9573E12 function: 1.0488433553061055E13 point: 14.0 - 1.44626E13 function: 1.086525148713279E13 point: 15.0 - 1.06865E14 function: 1.292878462686391E13 point: 16.0 - 7.8963E14 function: 2.4229119971194812E13 point: 17.0 - 5.83462E15 function: 8.611209942795956E13 point: 18.0 - 4.31123E16 function: 4.249961262960237E14 point: 19.0 - 3.18559E17 function: 2.2807953246289075E15 point: 20.0 - 2.35385E18 function: 1.2443536532475274E16 point: 21.0 - 1.73927E19 function: 6.8096814619047912E16 point: 22.0 - 1.28516E20 function: 3.7286570506270682E17 point: 23.0 - 9.49612E20 function: 2.04184334260224461E18 point: 24.0 - 7.01674E21 function: 1.1181510946313906E19 point: 25.0 - 5.18471E22 function: 6.123222584353946E19 point: 26.0 - 3.83101E23 function: 3.353203185774627E20 point: 27.0 - 2.83075E24 function: 1.8362835462312472E21 point: 28.0 - 2.09166E25 function: 1.0055869403818766E22 point: 29.0 - 1.54554E26 function: 5.506802588140335E22 kind regards, Christiaan -- View this message in context: http://apache-commons.680414.n4.nabble.com/Math-Exponential-curve-fitting-problem-tp2995629p2995629.html Sent from the Commons - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [Fileupload] Missing character in the middle of a file
At first I thought the lengths were different, but that was actually in a much more complex set of tests. I wrote the test code below after my first post to the list. Here's what that code is doing: The lengths are the same, but the byte at position 305 is -1 rather than -66. The answers to your other questions are inline: What is the CLOSE_BOUNDARY being used for? I don't believe you need that at the end of your stream. Also, where does the part of the message come from that has Content-Type: multipart/form-data? Is that external? The close boundary closes the body. It is the boundary plus -- like this: --Boundary ... --Boundary ... --Boundary-- That's part of the multipart specification. (http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2) The content type is set in the MockHttpServletRequest object. That code is rather long, so I didn't post it. It is also slightly messy because that is a mock. If you add files to the mock, it sets the content type to multipart/form-data. Have you compared the message you send to your test server with, for instance, the message that a web browser such as Firefox will send? No. I could write a simple HTTP server and spit out the InputStream bytes just to see. My only concern would be if Firefox is using a multi-boundary stream or something else that is allowable in the specification but not required. @Override public int available() throws IOException { return bytes.length; } This might not be correct, although it likely does not have an effect on your code. It should be correct if the headers aren't part of the length, which I believe they aren't: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html This is the length of the entity-body (message body), which should be the length of the multipart/form-data bytes I'm creating. But like you said, it shouldn't matter much. byte[] orig = read(new File(src/java/test/unit/org/jcatapult/servlet/test.jar)); byte[] read = read(file); assertEquals(orig.length, read.length); So, the above call fails because the files are 1 byte different? No. That was my original issue, but this code doesn't fail here. It fails in the loop. for (int i = 0; i orig.length; i++) { assertEquals(Byte at index + i + was invalid, orig[i], read[i]); } Without the length check, you get invalid starting at index 301 and continuing to the end of the file? No. The assert fails and then the loop stops. The invalid byte is at position 305. I have to ask again: Is the missing byte always at position 305? What variety of test files have you tried? Is it always 0xff that gets discarded? I'll try some other binary files now to see how they go. -bp - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [Fileupload] (SOLVED) Missing character in the middle of a file
I wanted to close this thread out. I figured out the issue. My stream wasn't correctly converting the bytes to ints. It needed to shift the bits so that if the byte FF was encountered it wasn't returned as -1, but as 255. In fact, all negative bytes were probably causing issues. The fix was to change my read method to this: public int read() throws IOException { return (index bytes.length) ? (bytes[index++] 0xff) : -1; } -bp - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: How can I get Commons-net-2.1 Source and Binaries
On 14 October 2010 13:31, James Carman ja...@carmanconsulting.com wrote: Why does the site list it in the release notes? Because that was correct at the time the site was updated, i.e. before 2.1 was even proposed for release. Note that there is no date associated with the release. However, it's a bit misleading now, so I'll change it to 2.2. Do we need to move all of the jira issues to 2.2? Possibly. Sounds like a discussion for the dev list. On Oct 14, 2010 3:36 AM, Jörg Schaible joerg.schai...@gmx.de wrote: 陳雪傑 wrote: Hi all How can I get Commons-net-2.1 Source and Binaries? I want get publiced Commons-net-2.1 Source and Binaries from apache, but the page (http://commons.apache.org/net/download_net.cgi) do not provide it. You cannot, since it was never officially released. So, yes, there is a tag in Subversion, but nobody knows, who spread it into public, what it actually contains and you're on your own using this code. Therefore you cannot download any binaries or tar balls, it has no direct support here. Actually you should use version 2.0 until we release the next version which will be 2.2. - Jörg - 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
when use FTPClient to do server to server file transfer's append failed
Hi all The action is server to which the client is connected to append to a given file on the other server The result is the new file replaced the remote file. I think FTPClient.java should change as follows: public boolean remoteAppend(String filename) throws IOException { if (__dataConnectionMode == ACTIVE_REMOTE_DATA_CONNECTION_MODE || __dataConnectionMode == PASSIVE_REMOTE_DATA_CONNECTION_MODE) //return FTPReply.isPositivePreliminary(stor(filename)); return FTPReply.isPositivePreliminary(appe(filename)); return false; } thanks --Xuejie Chen - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: [VFS] The same FileObject.exist() call returns different values in Windows 7 and Linux Ubuntu while connected to simple FTP
I'm sorry, Steven, but it's getting critical. I'm just testing my program on Linux 2.6.9-89.0.15.ELsmp and connecting to my home FTP server on port 10021. The same error is appearing. Can you please check it? Thanks. On 08.10.2010 20:21, Steven Siebert wrote: Ah, my apologies, I didn't notice that in the first email. I'll give the port a change tonight and hopefully I can replicate. S On Fri, Oct 8, 2010 at 1:16 PM, J-Pro jpro@gmail.com mailto:jpro@gmail.com wrote: Steven, thanks for trying. But do you use port number 1? I wrote before that I also have it working with regular 21 port. I have problems only with not default port, for example 1. Please try it. Thanks. On 07.10.2010 5:40, Steven Siebert wrote: So, just ran the tests... I connect to server using the ftp://user:p...@hostname/path/to/file/test.txt.asc.pgp and ask if it exists. I simplified the test code to two lines (not including exception handling): FileObject sourceDir = VFS.getManager().resolveFile(ftp://user:p...@hostname/stuff/test.txt.asc.pgp;); System.out.println(File exists: +sourceDir.exists()); Windows Vista: true Windows 7: true Ubuntu: true My Windows 7 environment is running JRE version 1.6.0_20. I used the latest binary (1.0) and from SVN (2.0), both test the same. Thoughts? S On Wed, Oct 6, 2010 at 3:28 PM, J-Pro jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com wrote: Thanks God somebody answered my question :) Thanks, Steven! Answering your questions: 1. Yes, destination(actually, it's source, because I take file from there) server remains the same, it's Windows 7 x64 Enterprise. FTP Server is Gene6 FTP Server v3.10.0. 2. Yes, the only thing I change - the OS where I'm launching my application. I just take the JAR, put it in different OS and run it from console(java -jar myapp.jar) - that's all. 3. About the file name, I'm sorry, it's my mistake, because in the listing it's wrong(I've took it from another place in the code). The file I'm trying to check for is test.txt.asc.pgp as I mentioned when specified FTP address. Forget about this long file name(,AMCPROD,derivative_pricing_ssb_cds_20100910_00.xml.pgp,U,20100910A00012022189.txt), I don't use it. Sorry for this mistake. So my correct listing is: String fileName = test.txt.asc.pgp; FileSystemManager fsManager = VFS.getManager(); UserAuthenticator auth = new StaticUserAuthenticator(null, login, password); FileSystemOptions srcOpts = new FileSystemOptions(); String sourceDirAsString = ftp://HOSTNAME:1/alex;; DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(srcOpts, auth); FileObject sourceDir = this.fsManager.resolveFile(dirAsString, opts); FileObject neededFile = sourceDir.resolveFile(fileName); return neededFile.exists(); If you need any more additional information, please ask, I'll give it to you. Thank you very much in advance. On 06.10.2010 21:16, Steven Siebert wrote: Hey JProI'll take a look at this tonight. If I understand correctly, the destination server remains the same between both calls (what OS is the destination server?). The only thing you are changing is the client your running your app on? Please confirm the name of the file you are trying to download is: ,AMCPROD,derivative_pricing_ssb_cds_20100910_00.xml.pgp,U,20100910A00012022189.txt? With a leading comma (,)? Are you using the DefaultFileSystemManager, or have you done anything special in this area? I assume for the **dir initialization** you are asking something like: dir = VFS.getManager().resolveFile(endpointURI[, FileSystemOptions]); Regards, Steve On Tue, Oct 5, 2010 at 12:58 PM, J-Pro jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com wrote: Sorry for
Re: [VFS] The same FileObject.exist() call returns different values in Windows 7 and Linux Ubuntu while connected to simple FTP
My apologies! I am finishing us a bit of refactoring on some utility and then I'll pop over to that. On Thu, Oct 14, 2010 at 9:13 PM, J-Pro jpro@gmail.com wrote: I'm sorry, Steven, but it's getting critical. I'm just testing my program on Linux 2.6.9-89.0.15.ELsmp and connecting to my home FTP server on port 10021. The same error is appearing. Can you please check it? Thanks. On 08.10.2010 20:21, Steven Siebert wrote: Ah, my apologies, I didn't notice that in the first email. I'll give the port a change tonight and hopefully I can replicate. S On Fri, Oct 8, 2010 at 1:16 PM, J-Pro jpro@gmail.com mailto: jpro@gmail.com wrote: Steven, thanks for trying. But do you use port number 1? I wrote before that I also have it working with regular 21 port. I have problems only with not default port, for example 1. Please try it. Thanks. On 07.10.2010 5:40, Steven Siebert wrote: So, just ran the tests... I connect to server using the ftp://user:p...@hostname/path/to/file/test.txt.asc.pgp and ask if it exists. I simplified the test code to two lines (not including exception handling): FileObject sourceDir = VFS.getManager().resolveFile(ftp://user:p...@hostname /stuff/test.txt.asc.pgp); System.out.println(File exists: +sourceDir.exists()); Windows Vista: true Windows 7: true Ubuntu: true My Windows 7 environment is running JRE version 1.6.0_20. I used the latest binary (1.0) and from SVN (2.0), both test the same. Thoughts? S On Wed, Oct 6, 2010 at 3:28 PM, J-Pro jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com wrote: Thanks God somebody answered my question :) Thanks, Steven! Answering your questions: 1. Yes, destination(actually, it's source, because I take file from there) server remains the same, it's Windows 7 x64 Enterprise. FTP Server is Gene6 FTP Server v3.10.0. 2. Yes, the only thing I change - the OS where I'm launching my application. I just take the JAR, put it in different OS and run it from console(java -jar myapp.jar) - that's all. 3. About the file name, I'm sorry, it's my mistake, because in the listing it's wrong(I've took it from another place in the code). The file I'm trying to check for is test.txt.asc.pgp as I mentioned when specified FTP address. Forget about this long file name(,AMCPROD,derivative_pricing_ssb_cds_20100910_00.xml.pgp,U,20100910A00012022189.txt), I don't use it. Sorry for this mistake. So my correct listing is: String fileName = test.txt.asc.pgp; FileSystemManager fsManager = VFS.getManager(); UserAuthenticator auth = new StaticUserAuthenticator(null, login, password); FileSystemOptions srcOpts = new FileSystemOptions(); String sourceDirAsString = ftp://HOSTNAME:1/alex;; DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(srcOpts, auth); FileObject sourceDir = this.fsManager.resolveFile(dirAsString, opts); FileObject neededFile = sourceDir.resolveFile(fileName); return neededFile.exists(); If you need any more additional information, please ask, I'll give it to you. Thank you very much in advance. On 06.10.2010 21:16, Steven Siebert wrote: Hey JProI'll take a look at this tonight. If I understand correctly, the destination server remains the same between both calls (what OS is the destination server?). The only thing you are changing is the client your running your app on? Please confirm the name of the file you are trying to download is: ,AMCPROD,derivative_pricing_ssb_cds_20100910_00.xml.pgp,U,20100910A00012022189.txt? With a leading comma (,)? Are you using the DefaultFileSystemManager, or have you done anything special in this area? I assume for the **dir initialization** you are asking something like: dir = VFS.getManager().resolveFile(endpointURI[, FileSystemOptions]); Regards, Steve On Tue, Oct 5, 2010 at 12:58 PM, J-Pro jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com mailto:jpro@gmail.com