Subversion Repositories XServices

Rev

Rev 65 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 69
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
import net.brutex.xservices.types.FileSetResource;
25
 
25
 
26
import net.brutex.xservices.types.ReturnCode;
26
import net.brutex.xservices.types.ReturnCode;
27
import net.brutex.xservices.util.BrutexNamespaces;
27
import net.brutex.xservices.util.BrutexNamespaces;
28
 
28
 
29
 
29
 
30
/**
30
/**
-
 
31
 * Archiving related web service.
31
 *
32
 * 
32
 * @author Brian Rosenberger, bru@brutex.de
33
 * @author Brian Rosenberger, bru@brutex.de
-
 
34
 * @since 0.4.0
33
 */
35
 */
34
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
36
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
35
public interface ArchiveService {
37
public interface ArchiveService {
36
 
38
 
37
    public static final String WS_OPERATION_BZIP2 = "bzip2";
39
    final String WS_OPERATION_BZIP2 = "bzip2";
38
    public static final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
40
    final String WS_OPERATION_BZIP2_ARCHIVE = "bzip2FromArchive";
39
    public static final String WS_OPERATION_GZIP = "gzip";
41
    final String WS_OPERATION_GZIP = "gzip";
40
    public static final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
42
    final String WS_OPERATION_GZIP_ARCHIVE = "gzipFromArchive";
41
    public static final String WS_OPERATION_UNZIP = "unzip";
43
    final String WS_OPERATION_UNZIP = "unzip";
42
    public static final String WS_OPERATION_GUNZIP = "gunzip";
44
    final String WS_OPERATION_GUNZIP = "gunzip";
43
    public static final String WS_OPERATION_BUNZIP2 = "bunzip2";
45
    final String WS_OPERATION_BUNZIP2 = "bunzip2";
44
    public static final String WS_PARAM_SOURCEFILE = "source";
46
    final String WS_PARAM_SOURCEFILE = "source";
45
    public static final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
47
    final String WS_PARAM_SOURCEFILE_STRING = "srcfile";
46
    public static final String WS_PARAM_SOURCEURL = "srcurl";
48
    final String WS_PARAM_SOURCEURL = "srcurl";
47
    public static final String WS_PARAM_SOURCEARCHIVE = "archivesource";
49
    final String WS_PARAM_SOURCEARCHIVE = "archivesource";
48
    public static final String WS_PARAM_DESTFILE = "destfile";
50
    final String WS_PARAM_DESTFILE = "destfile";
49
    public static final String WS_PARAM_DESTDIR = "destdir";
51
    final String WS_PARAM_DESTDIR = "destdir";
50
    public static final String WS_PARAM_ENCODING = "encoding";
52
    final String WS_PARAM_ENCODING = "encoding";
51
    public static final String WS_PARAM_OVERWRITE = "overwrite";
53
    final String WS_PARAM_OVERWRITE = "overwrite";
52
    public static final String WS_PARAM_COMPRESS = "compresslevel";
54
    final String WS_PARAM_COMPRESS = "compresslevel";
53
 
55
 
54
    /**
56
    /**
55
     * @param src
57
     * @param src
56
     * @param file
58
     * @param file
57
     * @return
59
     * @return
58
     * @throws XServicesFault 
60
     * @throws XServicesFault 
59
     */
61
     */
60
    @WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
62
    @WebMethod(operationName = WS_OPERATION_BZIP2, action = WS_OPERATION_BZIP2)
61
    public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
63
    public ReturnCode bzip2(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
62
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
64
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
63
 
65
 
64
    /**
66
    /**
65
     * @param src
67
     * @param src
66
     * @param file
68
     * @param file
67
     * @return
69
     * @return
68
     * @throws XServicesFault 
70
     * @throws XServicesFault 
69
     */
71
     */
70
    @WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
72
    @WebMethod(operationName = WS_OPERATION_BZIP2_ARCHIVE, action = WS_OPERATION_BZIP2_ARCHIVE)
71
    public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
73
    public ReturnCode bzip2FromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
72
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
74
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
73
 
75
 
74
    /**
76
    /**
75
     * @param src
77
     * @param src
76
     * @param file
78
     * @param file
77
     * @return
79
     * @return
78
     * @throws XServicesFault 
80
     * @throws XServicesFault 
79
     */
81
     */
80
    @WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
82
    @WebMethod(operationName = WS_OPERATION_GZIP, action = WS_OPERATION_GZIP)
81
    public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
83
    public ReturnCode gzip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
82
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
84
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
83
 
85
 
84
    /**
86
    /**
85
     * @param src
87
     * @param src
86
     * @param file
88
     * @param file
87
     * @return
89
     * @return
88
     * @throws XServicesFault 
90
     * @throws XServicesFault 
89
     */
91
     */
90
    @WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
92
    @WebMethod(operationName = WS_OPERATION_GZIP_ARCHIVE, action = WS_OPERATION_GZIP_ARCHIVE)
91
    public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
93
    public ReturnCode gzipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
92
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
94
            @WebParam(name = WS_PARAM_DESTFILE) String file) throws XServicesFault;
93
 
95
 
94
    /**
96
    /**
95
     * @param src
97
     * @param src
96
     * @param dest
98
     * @param dest
97
     * @return
99
     * @return
98
     * @throws XServicesFault 
100
     * @throws XServicesFault 
99
     */
101
     */
100
    @WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
102
    @WebMethod(operationName = WS_OPERATION_GUNZIP, action = WS_OPERATION_GUNZIP)
101
    public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
103
    public ReturnCode gunzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
102
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
104
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
103
 
105
 
104
    /**
106
    /**
105
     * @param src
107
     * @param src
106
     * @param dest
108
     * @param dest
107
     * @return
109
     * @return
108
     * @throws XServicesFault 
110
     * @throws XServicesFault 
109
     */
111
     */
110
    @WebMethod(operationName = WS_OPERATION_BUNZIP2)
112
    @WebMethod(operationName = WS_OPERATION_BUNZIP2)
111
    public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
113
    public ReturnCode bunzip2(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
112
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
114
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
113
 
115
 
114
    /**
116
    /**
115
     * @param src
117
     * @param src
116
     * @param dest
118
     * @param dest
117
     * @return
119
     * @return
118
     * @throws XServicesFault 
120
     * @throws XServicesFault 
119
     */
121
     */
120
    @WebMethod(operationName = "gunzipFromURL")
122
    @WebMethod(operationName = "gunzipFromURL")
121
    public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
123
    public ReturnCode gunzipFromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
122
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
124
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
123
 
125
 
124
    /**
126
    /**
125
     * @param src
127
     * @param src
126
     * @param dest
128
     * @param dest
127
     * @return
129
     * @return
128
     * @throws XServicesFault 
130
     * @throws XServicesFault 
129
     */
131
     */
130
    @WebMethod(operationName = "bunzip2FromURL")
132
    @WebMethod(operationName = "bunzip2FromURL")
131
    public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
133
    public ReturnCode bunzip2FromURL(@WebParam(name = WS_PARAM_SOURCEURL) String src,
132
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
134
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
133
 
135
 
134
    /**
136
    /**
135
     * @param src
137
     * @param src
136
     * @param file
138
     * @param file
137
     * @param overwrite
139
     * @param overwrite
138
     * @param encoding
140
     * @param encoding
139
     * @param level
141
     * @param level
140
     * @return
142
     * @return
141
     * @throws XServicesFault 
143
     * @throws XServicesFault 
142
     */
144
     */
143
    @WebMethod(operationName = "zip")
145
    @WebMethod(operationName = "zip")
144
    public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
146
    public ReturnCode zip(@WebParam(name = WS_PARAM_SOURCEFILE) FileResource src,
145
            @WebParam(name = WS_PARAM_DESTFILE) String file,
147
            @WebParam(name = WS_PARAM_DESTFILE) String file,
146
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
148
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
147
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
149
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
148
            @WebParam(name = WS_PARAM_COMPRESS) int level) throws XServicesFault;
150
            @WebParam(name = WS_PARAM_COMPRESS) int level) throws XServicesFault;
149
 
151
 
150
    /**
152
    /**
151
     * @param src
153
     * @param src
152
     * @param file
154
     * @param file
153
     * @param update
155
     * @param update
154
     * @param encoding
156
     * @param encoding
155
     * @param level
157
     * @param level
156
     * @return
158
     * @return
157
     * @throws XServicesFault 
159
     * @throws XServicesFault 
158
     */
160
     */
159
    @WebMethod(operationName = "zipFromArchive")
161
    @WebMethod(operationName = "zipFromArchive")
160
    public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
162
    public ReturnCode zipFromArchive(@WebParam(name = WS_PARAM_SOURCEARCHIVE) ArchiveResource src,
161
            @WebParam(name = WS_PARAM_DESTFILE) String file,
163
            @WebParam(name = WS_PARAM_DESTFILE) String file,
162
            @WebParam(name = WS_PARAM_OVERWRITE) boolean update,
164
            @WebParam(name = WS_PARAM_OVERWRITE) boolean update,
163
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
165
            @WebParam(name = WS_PARAM_ENCODING) String encoding,
164
            @WebParam(name = "compresslevel") int level) throws XServicesFault;
166
            @WebParam(name = "compresslevel") int level) throws XServicesFault;
165
 
167
 
166
    /**
168
    /**
167
     * @param src
169
     * @param src
168
     * @param dest
170
     * @param dest
169
     * @param overwrite
171
     * @param overwrite
170
     * @param encoding
172
     * @param encoding
171
     * @return
173
     * @return
172
     * @throws XServicesFault 
174
     * @throws XServicesFault 
173
     */
175
     */
174
    @WebMethod(operationName = "unzip")
176
    @WebMethod(operationName = "unzip")
175
    public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
177
    public ReturnCode unzip(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
176
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
178
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
177
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
179
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
178
            @WebParam(name = WS_PARAM_ENCODING) String encoding) throws XServicesFault;
180
            @WebParam(name = WS_PARAM_ENCODING) String encoding) throws XServicesFault;
179
 
181
 
180
    /**
182
    /**
181
     * @param src
183
     * @param src
182
     * @param dest
184
     * @param dest
183
     * @return
185
     * @return
184
     * @throws XServicesFault 
186
     * @throws XServicesFault 
185
     */
187
     */
186
    @WebMethod(operationName = "unrar")
188
    @WebMethod(operationName = "unrar")
187
    public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
189
    public ReturnCode unrar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
188
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
190
            @WebParam(name = WS_PARAM_DESTDIR) String dest) throws XServicesFault;
189
 
191
 
190
    /**
192
    /**
191
     * @param src
193
     * @param src
192
     * @param dest
194
     * @param dest
193
     * @param overwrite
195
     * @param overwrite
194
     * @param compression
196
     * @param compression
195
     * @return
197
     * @return
196
     * @throws XServicesFault 
198
     * @throws XServicesFault 
197
     */
199
     */
198
    @WebMethod(operationName = "untar")
200
    @WebMethod(operationName = "untar")
199
    public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
201
    public ReturnCode untar(@WebParam(name = WS_PARAM_SOURCEFILE_STRING) String src,
200
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
202
            @WebParam(name = WS_PARAM_DESTDIR) String dest,
201
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
203
            @WebParam(name = WS_PARAM_OVERWRITE) boolean overwrite,
202
            @WebParam(name = "compression") CompressionType compression) throws XServicesFault;
204
            @WebParam(name = "compression") CompressionType compression) throws XServicesFault;
203
}
205
}