64 |
brianR |
1 |
/*
|
|
|
2 |
* Copyright 2010 Brian Rosenberger (Brutex Network)
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (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
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
46 |
brianR |
17 |
package net.brutex.xservices.ws;
|
|
|
18 |
|
63 |
brianR |
19 |
import java.util.List;
|
|
|
20 |
|
46 |
brianR |
21 |
import javax.jws.WebMethod;
|
|
|
22 |
import javax.jws.WebParam;
|
|
|
23 |
import javax.jws.WebService;
|
64 |
brianR |
24 |
import javax.xml.bind.annotation.XmlElement;
|
46 |
brianR |
25 |
|
64 |
brianR |
26 |
import org.apache.cxf.annotations.WSDLDocumentation;
|
|
|
27 |
import org.apache.cxf.annotations.WSDLDocumentationCollection;
|
|
|
28 |
|
|
|
29 |
import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
|
|
|
30 |
|
46 |
brianR |
31 |
import net.brutex.xservices.types.ArchiveResource;
|
54 |
brianR |
32 |
import net.brutex.xservices.types.AttachmentType;
|
46 |
brianR |
33 |
import net.brutex.xservices.types.FileResource;
|
|
|
34 |
import net.brutex.xservices.types.FileSetResource;
|
63 |
brianR |
35 |
import net.brutex.xservices.types.ReplacePattern;
|
46 |
brianR |
36 |
import net.brutex.xservices.types.ReturnCode;
|
|
|
37 |
import net.brutex.xservices.util.BrutexNamespaces;
|
64 |
brianR |
38 |
import net.brutex.xservices.util.XServicesDocumentation;
|
|
|
39 |
/**
|
|
|
40 |
* @author Brian Rosenberger
|
|
|
41 |
*
|
|
|
42 |
*/
|
46 |
brianR |
43 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
64 |
brianR |
44 |
@WSDLDocumentationCollection(
|
|
|
45 |
{
|
|
|
46 |
@WSDLDocumentation(value = BrutexNamespaces.BRUTEX_COPYRIGHT, placement = WSDLDocumentation.Placement.TOP)
|
|
|
47 |
}
|
|
|
48 |
)
|
46 |
brianR |
49 |
public interface FileService {
|
|
|
50 |
|
64 |
brianR |
51 |
/**
|
|
|
52 |
* @param filename
|
|
|
53 |
* @param suffix
|
|
|
54 |
* @return The base name of the given file excluding the suffix.
|
|
|
55 |
*/
|
|
|
56 |
@WSDLDocumentation(value = "The base name of the given file excluding the suffix.")
|
46 |
brianR |
57 |
@WebMethod(operationName = "basename")
|
64 |
brianR |
58 |
public abstract String basename(
|
|
|
59 |
@WebParam(name = "file") @XmlElement(required=true) String filename,
|
46 |
brianR |
60 |
@WebParam(name = "suffix") String suffix);
|
|
|
61 |
|
64 |
brianR |
62 |
/**
|
|
|
63 |
* @param res
|
|
|
64 |
* @return The file itself (MTOM attachment or inline base64) including some file metadata.
|
|
|
65 |
*/
|
|
|
66 |
@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_DOWNLOADFILE)
|
54 |
brianR |
67 |
@WebMethod(operationName = "downloadFile")
|
|
|
68 |
public abstract AttachmentType downloadFile(
|
|
|
69 |
@WebParam(name = "file") FileResource res);
|
|
|
70 |
|
64 |
brianR |
71 |
/**
|
|
|
72 |
* @param file
|
|
|
73 |
* @return The file name of the file that has been uploaded.
|
|
|
74 |
*/
|
|
|
75 |
@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_UPLOADFILE)
|
54 |
brianR |
76 |
@WebMethod(operationName = "uploadFile")
|
|
|
77 |
public abstract String uploadFile(
|
|
|
78 |
@WebParam(name = "file") AttachmentType file);
|
|
|
79 |
|
64 |
brianR |
80 |
/**
|
|
|
81 |
* @param src
|
|
|
82 |
* @param todir
|
|
|
83 |
* @param plm
|
|
|
84 |
* @param overwrite
|
|
|
85 |
* @param encoding
|
|
|
86 |
* @return
|
|
|
87 |
* @throws XServicesFault
|
|
|
88 |
*/
|
|
|
89 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPY)
|
46 |
brianR |
90 |
@WebMethod(operationName = "copy")
|
|
|
91 |
public abstract ReturnCode copy(
|
64 |
brianR |
92 |
@WebParam(name = "fileset") @XmlElement(required=true) FileSetResource src,
|
|
|
93 |
@WebParam(name = "todir") @XmlElement(required=true) String todir,
|
46 |
brianR |
94 |
@WebParam(name = "preservelastmodified") boolean plm,
|
|
|
95 |
@WebParam(name = "overwrite") boolean overwrite,
|
|
|
96 |
@WebParam(name = "encoding") String encoding) throws XServicesFault;
|
64 |
brianR |
97 |
|
|
|
98 |
/**
|
|
|
99 |
* @param fromFile
|
|
|
100 |
* @param tofile
|
|
|
101 |
* @param overwrite
|
|
|
102 |
* @return
|
|
|
103 |
* @throws XServicesFault
|
|
|
104 |
*/
|
|
|
105 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPYFILE)
|
|
|
106 |
@WebMethod(operationName = "copyFile")
|
|
|
107 |
public abstract ReturnCode copyFile(
|
|
|
108 |
@WebParam(name = "fromFile") @XmlElement(required=true) String fromFile,
|
|
|
109 |
@WebParam(name = "toFile") @XmlElement(required=true) String tofile,
|
|
|
110 |
@WebParam(name = "overwrite") boolean overwrite) throws XServicesFault;
|
46 |
brianR |
111 |
|
64 |
brianR |
112 |
/**
|
|
|
113 |
* @param res
|
|
|
114 |
* @param encoding
|
|
|
115 |
* @return content of the resource
|
|
|
116 |
*/
|
|
|
117 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCE)
|
46 |
brianR |
118 |
@WebMethod(operationName = "loadResource")
|
64 |
brianR |
119 |
public abstract String loadRes(
|
46 |
brianR |
120 |
@WebParam(name = "resource") FileResource res,
|
|
|
121 |
@WebParam(name = "encoding") String encoding);
|
|
|
122 |
|
64 |
brianR |
123 |
/**
|
|
|
124 |
* @param res
|
|
|
125 |
* @param encoding
|
|
|
126 |
* @return content of the resource
|
|
|
127 |
*/
|
|
|
128 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCEFROMARCHIVE)
|
46 |
brianR |
129 |
@WebMethod(operationName = "loadResourceFromArchive")
|
64 |
brianR |
130 |
public abstract String loadResFromArchive(
|
46 |
brianR |
131 |
@WebParam(name = "archiveresource") ArchiveResource res,
|
|
|
132 |
@WebParam(name = "encoding") String encoding);
|
|
|
133 |
|
64 |
brianR |
134 |
/**
|
|
|
135 |
* @param message
|
|
|
136 |
* @param file
|
|
|
137 |
* @param encoding
|
|
|
138 |
* @param append
|
|
|
139 |
* @return
|
|
|
140 |
*/
|
|
|
141 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_ECHOTOFILE)
|
46 |
brianR |
142 |
@WebMethod(operationName = "echoToFile")
|
|
|
143 |
public abstract ReturnCode echo2file(
|
64 |
brianR |
144 |
@WebParam(name = "message") @XmlElement(required=true) String message,
|
|
|
145 |
@WebParam(name = "file") @XmlElement(required=true) String file,
|
46 |
brianR |
146 |
@WebParam(name = "encoding") String encoding,
|
|
|
147 |
@WebParam(name = "append") boolean append);
|
|
|
148 |
|
|
|
149 |
@WebMethod(operationName = "changeOwner")
|
|
|
150 |
public abstract ReturnCode changeOwner(
|
|
|
151 |
@WebParam(name = "fileset") FileSetResource res,
|
64 |
brianR |
152 |
@WebParam(name = "owner") @XmlElement(required=true) String owner);
|
46 |
brianR |
153 |
|
|
|
154 |
@WebMethod(operationName = "changeGroup")
|
|
|
155 |
public abstract ReturnCode changeGroup(
|
|
|
156 |
@WebParam(name = "fileset") FileSetResource res,
|
64 |
brianR |
157 |
@WebParam(name = "group") @XmlElement(required=true) String group);
|
46 |
brianR |
158 |
|
|
|
159 |
@WebMethod(operationName = "changeMode")
|
|
|
160 |
public abstract ReturnCode changeMode(
|
|
|
161 |
@WebParam(name = "fileset") FileSetResource res,
|
64 |
brianR |
162 |
@WebParam(name = "permissions") @XmlElement(required=true) String perm);
|
63 |
brianR |
163 |
|
|
|
164 |
@WebMethod(operationName = "replaceInFile")
|
|
|
165 |
public abstract ReturnCode replaceInFile(
|
64 |
brianR |
166 |
@WebParam(name = "file") @XmlElement(required=true) FileResource res,
|
|
|
167 |
@WebParam(name = "search") @XmlElement(required=true) String search,
|
|
|
168 |
@WebParam(name = "replace") @XmlElement(required=true) String replace);
|
63 |
brianR |
169 |
|
|
|
170 |
@WebMethod(operationName = "replaceInFile2")
|
|
|
171 |
public abstract ReturnCode replaceInFile2(
|
|
|
172 |
@WebParam(name = "file") FileResource res,
|
|
|
173 |
@WebParam(name = "patternList") List<ReplacePattern> patternList);
|
|
|
174 |
|
|
|
175 |
@WebMethod(operationName = "replaceInFileRegEx")
|
|
|
176 |
public abstract ReturnCode replaceInFileRegEx(
|
|
|
177 |
@WebParam(name = "file") FileResource res,
|
|
|
178 |
@WebParam(name = "search") String search,
|
|
|
179 |
@WebParam(name = "replace") String replace,
|
|
|
180 |
@WebParam(name = "flags") String flags);
|
46 |
brianR |
181 |
}
|