KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > common > FileTransfer


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.admin.common;
25
26 import java.io.File JavaDoc;
27 import java.io.IOException JavaDoc;
28
29 /*
30  * FileTransfer.java
31  *
32  */

33
34 /** Interface to upload & download a given file to the server.
35  */

36 public interface FileTransfer {
37      
38     /** uploads the given file to the server running at the host:port with
39      * authentication. Assumes jmx-remote with s1ashttp protocol.
40      * @param filePath the absolute path to the file to be uploaded
41      * @throws IOException for IO related exceptions
42      * @return The full path of the uploaded file
43      */

44     public String JavaDoc uploadFile(String JavaDoc filePath) throws IOException JavaDoc ;
45            
46    /**
47      * Exports the Client stub jar to the given location.
48      * @param appName The name of the application or module.
49      * @param destDir The directory into which the stub jar file
50      * should be exported.
51      * @return Returns the absolute location to the exported jar file.
52      * @throws IOException for IO related exceptions
53      */

54     public String JavaDoc downloadClientStubs(String JavaDoc appName, String JavaDoc destDir) throws IOException JavaDoc;
55
56     /**
57      * downloads file to the given location.
58      * @param filePath the absolute path to the file to be downloaded
59      * @param destDir The directory into which the stub jar file
60      * should be exported.
61      * @return Returns the absolute location to the exported jar file.
62      * @throws IOException for IO related exceptions
63      */

64     public String JavaDoc downloadFile(String JavaDoc filePath, String JavaDoc destinationDirPath) throws IOException JavaDoc;
65
66     /**
67      * Downloads file to the given location. This method supports multiple
68      * distributed clients.
69      *
70      * @param filePath the absolute path to the file to be downloaded
71      * @param destPath local file path where file should be downloaded
72      *
73      * @return the absolute location to the downloaded jar file
74      *
75      * @throws IOException for IO related exceptions
76      */

77     public String JavaDoc mcDownloadFile(String JavaDoc filePath, File JavaDoc destPath)
78         throws IOException JavaDoc;
79
80 }
81
Popular Tags