1 |
/*
|
1 |
/*
|
2 |
* Copyright 2010 Brian Rosenberger (Brutex Network)
|
2 |
* Copyright 2010 Brian Rosenberger (Brutex Network)
|
3 |
*
|
3 |
*
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
* you may not use this file except in compliance with the License.
|
5 |
* you may not use this file except in compliance with the License.
|
6 |
* You may obtain a copy of the License at
|
6 |
* You may obtain a copy of the License at
|
7 |
*
|
7 |
*
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
*
|
9 |
*
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
* See the License for the specific language governing permissions and
|
13 |
* See the License for the specific language governing permissions and
|
14 |
* limitations under the License.
|
14 |
* limitations under the License.
|
15 |
*/
|
15 |
*/
|
16 |
package net.brutex.xservices.ws;
|
16 |
package net.brutex.xservices.ws;
|
17 |
|
17 |
|
18 |
import javax.jws.WebMethod;
|
18 |
import javax.jws.WebMethod;
|
19 |
import javax.jws.WebParam;
|
19 |
import javax.jws.WebParam;
|
20 |
import javax.jws.WebService;
|
20 |
import javax.jws.WebService;
|
21 |
import net.brutex.xservices.types.ArchiveResource;
|
21 |
import net.brutex.xservices.types.ArchiveResource;
|
22 |
import net.brutex.xservices.types.CompressionType;
|
22 |
import net.brutex.xservices.types.CompressionType;
|
23 |
import net.brutex.xservices.types.FileResource;
|
23 |
import net.brutex.xservices.types.FileResource;
|
- |
|
24 |
import net.brutex.xservices.types.FileSetResource;
|
24 |
|
25 |
|
25 |
import net.brutex.xservices.types.ReturnCode;
|
26 |
import net.brutex.xservices.types.ReturnCode;
|
26 |
import net.brutex.xservices.util.BrutexNamespaces;
|
27 |
import net.brutex.xservices.util.BrutexNamespaces;
|
27 |
|
28 |
|
28 |
|
29 |
|
29 |
/**
|
30 |
/**
|
30 |
*
|
31 |
*
|
31 |
* @author Brian Rosenberger, bru@brutex.de
|
32 |
* @author Brian Rosenberger, bru@brutex.de
|
32 |
*/
|
33 |
*/
|
33 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
34 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
34 |
public interface ArchiveService {
|
35 |
public interface ArchiveService {
|
35 |
|
36 |
|
36 |
public static final String WS_OPERATION_BZIP2 = "bzip2";
|
37 |
public static final String WS_OPERATION_BZIP2 = "bzip2";
|
37 |
public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
|
38 |
public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
|
38 |
public static final String WS_OPERATION_GZIP = "gzip";
|
39 |
public static final String WS_OPERATION_GZIP = "gzip";
|
39 |
public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
|
40 |
public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
|
40 |
public static final String WS_OPERATION_UNZIP = "unzip";
|
41 |
public static final String WS_OPERATION_UNZIP = "unzip";
|
41 |
public static final String WS_OPERATION_GUNZIP = "gunzip";
|
42 |
public static final String WS_OPERATION_GUNZIP = "gunzip";
|
42 |
public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
|
43 |
public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
|
43 |
public static final String WS_PARAM_SOURCEFILE = "source";
|
44 |
public static final String WS_PARAM_SOURCEFILE = "source";
|
44 |
public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
|
45 |
public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
|
45 |
public static final String WS_PARAM_SOURCEURL = "srcurl";
|
46 |
public static final String WS_PARAM_SOURCEURL = "srcurl";
|
46 |
public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
|
47 |
public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
|
47 |
public static final String WS_PARAM_DESTFILE = "destfile";
|
48 |
public static final String WS_PARAM_DESTFILE = "destfile";
|
48 |
public static final String WS_PARAM_DESTDIR = "destdir";
|
49 |
public static final String WS_PARAM_DESTDIR = "destdir";
|
49 |
public static final String WS_PARAM_ENCODING = "encoding";
|
50 |
public static final String WS_PARAM_ENCODING = "encoding";
|
50 |
public static final String WS_PARAM_OVERWRITE = "overwrite";
|
51 |
public static final String WS_PARAM_OVERWRITE = "overwrite";
|
51 |
|
52 |
|
52 |
@WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
|
53 |
@WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
|
53 |
public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
54 |
public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
54 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
55 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
55 |
|
56 |
|
56 |
@WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
|
57 |
@WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
|
57 |
public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
58 |
public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
58 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
59 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
59 |
|
60 |
|
60 |
@WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
|
61 |
@WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
|
61 |
public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
62 |
public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
62 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
63 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
63 |
|
64 |
|
64 |
@WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
|
65 |
@WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
|
65 |
public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
66 |
public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
66 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
67 |
@WebParam(name = WS_PARAM_DESTFILE) String file);
|
67 |
|
68 |
|
68 |
@WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
|
69 |
@WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
|
69 |
public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
70 |
public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
70 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
71 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
71 |
|
72 |
|
72 |
@WebMethod(operationName = WS_OPERATION_BUNZIP2)
|
73 |
@WebMethod(operationName = WS_OPERATION_BUNZIP2)
|
73 |
public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
74 |
public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
74 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
75 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
75 |
|
76 |
|
76 |
@WebMethod(operationName = "gunzipFromURL")
|
77 |
@WebMethod(operationName = "gunzipFromURL")
|
77 |
public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
|
78 |
public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
|
78 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
79 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
79 |
|
80 |
|
80 |
@WebMethod(operationName = "bunzip2FromURL")
|
81 |
@WebMethod(operationName = "bunzip2FromURL")
|
81 |
public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
|
82 |
public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
|
82 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
83 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
83 |
|
84 |
|
84 |
@WebMethod(operationName = "zip")
|
85 |
@WebMethod(operationName = "zip")
|
85 |
public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
86 |
public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
|
86 |
@WebParam(name = WS_PARAM_DESTFILE) String file,
|
87 |
@WebParam(name = WS_PARAM_DESTFILE) String file,
|
87 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
88 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
88 |
@WebParam(name = WS_PARAM_ENCODING) String encoding,
|
89 |
@WebParam(name = WS_PARAM_ENCODING) String encoding,
|
89 |
@WebParam(name = "compresslevel") int level);
|
90 |
@WebParam(name = "compresslevel") int level);
|
90 |
|
91 |
|
91 |
@WebMethod(operationName = "zipFromArchive")
|
92 |
@WebMethod(operationName = "zipFromArchive")
|
92 |
public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
93 |
public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
|
93 |
@WebParam(name = WS_PARAM_DESTFILE) String file,
|
94 |
@WebParam(name = WS_PARAM_DESTFILE) String file,
|
94 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean update,
|
95 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean update,
|
95 |
@WebParam(name = WS_PARAM_ENCODING) String encoding,
|
96 |
@WebParam(name = WS_PARAM_ENCODING) String encoding,
|
96 |
@WebParam(name = "compresslevel") int level);
|
97 |
@WebParam(name = "compresslevel") int level);
|
97 |
|
98 |
|
98 |
@WebMethod(operationName = "unzip")
|
99 |
@WebMethod(operationName = "unzip")
|
99 |
public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
100 |
public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
100 |
@WebParam(name = WS_PARAM_DESTDIR) String dest,
|
101 |
@WebParam(name = WS_PARAM_DESTDIR) String dest,
|
101 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
102 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
102 |
@WebParam(name = WS_PARAM_ENCODING) String encoding);
|
103 |
@WebParam(name = WS_PARAM_ENCODING) String encoding);
|
103 |
|
104 |
|
104 |
@WebMethod(operationName = "unrar")
|
105 |
@WebMethod(operationName = "unrar")
|
105 |
public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
106 |
public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
106 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
107 |
@WebParam(name = WS_PARAM_DESTDIR) String dest);
|
107 |
|
108 |
|
108 |
@WebMethod(operationName = "untar")
|
109 |
@WebMethod(operationName = "untar")
|
109 |
public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
110 |
public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
|
110 |
@WebParam(name = WS_PARAM_DESTDIR) String dest,
|
111 |
@WebParam(name = WS_PARAM_DESTDIR) String dest,
|
111 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
112 |
@WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
|
112 |
@WebParam(name = "compression") CompressionType compression);
|
113 |
@WebParam(name = "compression") CompressionType compression);
|
113 |
}
|
114 |
}
|