blob: 0fe08ab6db339fba2e43a8540c20cfef4455759c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// This method takes in a url and a prefix name and pulls that url across the
// network, stores it in a local file named prefix
// for now it assumes that the url is an image only !
import java.net.* ;
import java.io.* ;
import java.awt.* ;
public class url_to_url {
Image im ;
public url_to_url(URL url,String prefix) {
try {
im = (Image)url.getContent();
} catch (IOException i) {}
String www_path = System.getProperty("www-path");
String home_dir = System.getProperty("user.home");
String dir = home_dir + www_path ;
System.out.println("web dir is this : " + dir);
}
public static void main(String[] argv) {
URL test = null ;
try {
test = new URL("http://www.cs.wustl.edu/~rajeev/images/sand.jpg");
} catch ( MalformedURLException e) {}
url_to_url t = new url_to_url(test,"root") ;
}
}
|