This week's book giveaway is in the Python forum.
We're giving away four copies of High Performance Python for Data Analytics and have Tiago Rodrigues Antao on-line!
See this thread for details.
Win a copy of High Performance Python for Data Analytics this week in the Python forum!

Ilya PA

Greenhorn
+ Follow
since Sep 05, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ilya PA

Hi,

I figured it out. It was my own problem, the site that I had to connect to and download files from had a bunch of hidden fields, which were necessary for successful connection. I got to know about only after wasting couple of days trying to figure out whats wrong with GET, when all I needed was a POST with a bunch of parameters hidden on the form.

Cheers,
Ilya.
15 years ago
Well, here is my code that does the read with body returned as a byte array:



And here is the output it produces:


http://yyy.com/send-file.cgi?action=Download&filename=test.000
The answer is []


If the code is right, then it appears like the body is empty.
Here is the code of the same thing with getResponseBodyAsStream():


And the output for this one is:


http://yyy.com/send-file.cgi?action=Download&filename=test.000
The body is []


Am I doing something wrong?

Thank you,
Ilya.

[ November 23, 2005: Message edited by: Ilya PA ]

[ November 23, 2005: Message edited by: Ilya PA ]
[ November 23, 2005: Message edited by: Ilya PA ]
15 years ago
Dear reader,

I've been trying to figure this out since monday, searching through bunches of google groups and what not.. without finding answers. See if you guys have any idea of what's causing this to fail so miserably.

I am trying to programmatically download a file from a website. The way it works manually is as follows:

1. User clicks on a 'Download' button
2. HTTP GET is sent to the server:
http://yyy.com/send-file.cgi?action=Download&filename=myfile.000
3. In response a dialog box pops up, user is prompted to choose path and save the file
4. User clicks save, and file is downloaded

The dialog box pops up because the server's response header has Content-Disposition set to attachment. This way the file is not stored in the message body, but in the attachment. Here are the server's response headers:
Server: HTTPD/1.0.0
Content-Disposition: attachment; filename=myfile.000
Content-Length: 0
Vary: Accept-Encoding,User-Agent
Content-Type: application/x-force-download

Commons' HttpClient, provides methods to read the message body, headers and footers, however I could not figure out whether the attachment is stored in either of the three, or whether I need to look for another API (suggestions welcomed!) to get that file in from an application.

Thanks ahead for any ideas/direction,

Kind regards,
Ilya.
15 years ago
Hi guys,
Could you please give me a hand in this... i've gotta write an analysis for an open source jini(or jxta or .net) application as my uni assignment, but i seem to have troubles finding one. Could you please be so kind and share few links witn me if you know any.
Thank you very much,
Ilya.
17 years ago
Hi Maulin,
Thank you very much for staying with me all this time. The example you've given was helpful to understand the use of the System.getProperty("user.dir"). But also would like to know if it is possible to get the directory that "the class was loaded from" as you have mentioned in your last reply.
Please excuse my english. It took me quite some time to deliver my question right.
Thanks heaps,
Ilya.
17 years ago
Thank you for the reply,
but the output of the
System.getProperty("user.dir")
is the Java SDK directory, but i would like to get the address of a location where my classes are stored, not the SDK. Is it possible to get that?
Thanx alot!
Ilya.
17 years ago
Hi,
I am experiencing a difficulty to specify the current directory as a path to an input text file in a program that reads from a file. JVM only accepts an absolute path to my input.txt and not the relative. How can i specify the current directory(relative to the class file with the main() method in it) as a parameter for the FileReader's constructor using the relative path?
Thank you very much,
Ilya.
17 years ago
Hi,
THis is a very nasty problem that i'm having... Was looking through groups here and there the whole evening and already feeling sick of RMI. Please somebody help. The problem that i'm fighting here is following: I seem to be unable to bind the remoteInterfaceImlementation to the RMI registry. I'll describe in more detail what i was doing...
1)I run WinXP on my machine with J2SDK1.4.0
2)I've written a simple to the core RMI program, that has an Interface, InterfaceImplementation, RemoteClient and a RemoteServer, and stored it in the 'C:\RMIExample' folder
3)My actions to run it step by step, where specified above directory is set as the current one:
1.>javac *.java
2.>rmic InterfaceImplementation
3.>SET CLASSPATH=
4.>rmiregistry
5.>SET CLASSPATH=c:\RMIExample
6.>java -Djava.rmi.server.codebase=file:/C:\RMIExample/ -Djava.security.policy=java.policy RemoteServer
And this is the place where the nasty error pops up, saying:
java.lang.ClassNotFoundException: InterfaceImplementation_Stub
I had problems getting the explanation of the sun website(http://java.sun.com/products/jdk/1.2/docs/guide/rmi/codebase.html), They only mentioned a bit about it...

Thanks heaps for your time and help!
18 years ago
Thanks alot for your help, Cindy. I'll make sure that this lil' error will never happen again!
18 years ago
Please help!
I was trying to create a simple application with few classes. When it was complete, i've tried to complile it from dos prompt, and i've got this strange error... :
Exception in thread "main" java.lang.NoClassDefFound Error : MyClassName
Please tell me what is the reson for this? How could i fix it up?
Thanking you,
Ilya
18 years ago
Hi, Margaret. It may sound a bit strange, but i think that 'out' is an object of 'System' class, and 'println()' is the method of 'System' class. We cannot say to a class to print(because a class is just a description of an object) but can say it to the object. But I'm not sure where the 'out' object was created, though...
19 years ago
As far as I know, you cannot actually control your IP adress, when you are on dialup. It works this way: Your ISP has a modem pool with several modems on one tel number. Each of them has a different static ip adress. When you dial your isp's number, you are getting connected to one of these modems and your ip depends on ip of the provider's modem you got connected with. There is no way you can controll the modem you'll be connected with, because you will be connected to a modem which is currently free. And because the provider has many users connecting and disconnecting form the net all the time, it will be always(almost) a different modem => you'll have a different ip.
19 years ago
Hi. Please help! How to draw a point? I was trying to do it using the class point2D.float of the package java.awt.geom. But I just can't do it (i'm a begginner... as you can see :P), could you please show me how to use it correctly. What should I do to draw a point with coordinares of type float? Thank you!
19 years ago
Thank you, for the advice, but it just doesn't seem to work out that way... dunno why. But thanx anyway!
19 years ago
Hi... I was wrighting a program, and it has several ouputs. I was using
System.out.println("Bla bla bla");
But when I run it in the second time the ouput from the first run stays on the screen, how can I clear it before running? Is there any method like "clrscr;" in Pascal?
19 years ago