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 package org.archive.net.rsync;
26
27 import java.io.File;
28 import java.net.URL;
29
30 import org.archive.net.DownloadURLConnection;
31
32 /***
33 * Rsync URL connection.
34 * @author stack
35 * @version $Date: 2006-08-18 16:13:32 +0000 (Fri, 18 Aug 2006) $, $Revision: 4510 $
36 */
37 public class RsyncURLConnection extends DownloadURLConnection {
38 private final String RSYNC_TIMEOUT =
39 System.getProperty(RsyncURLConnection.class.getName() + ".timeout",
40 "300");
41
42 protected RsyncURLConnection(URL u) {
43 super(u);
44 }
45
46 protected String getScript() {
47 return System.getProperty(this.getClass().getName() + ".path",
48 "rsync");
49 }
50
51 @Override
52 protected String[] getCommand(final URL thisUrl,
53 final File downloadFile) {
54 return new String[] {getScript(), "--timeout=" + RSYNC_TIMEOUT,
55 this.url.getPath(), downloadFile.getAbsolutePath()};
56 }
57 }