Line 24... |
Line 24... |
24 |
import javax.xml.bind.annotation.XmlElement;
|
24 |
import javax.xml.bind.annotation.XmlElement;
|
Line 25... |
Line 25... |
25 |
|
25 |
|
26 |
import org.apache.cxf.annotations.WSDLDocumentation;
|
26 |
import org.apache.cxf.annotations.WSDLDocumentation;
|
Line 27... |
Line -... |
27 |
import org.apache.cxf.annotations.WSDLDocumentationCollection;
|
- |
|
28 |
|
- |
|
29 |
import com.sun.xml.internal.ws.api.model.wsdl.WSDLDescriptorKind;
|
27 |
import org.apache.cxf.annotations.WSDLDocumentationCollection;
|
30 |
|
28 |
|
31 |
import net.brutex.xservices.types.ArchiveResource;
|
29 |
import net.brutex.xservices.types.ArchiveResource;
|
32 |
import net.brutex.xservices.types.AttachmentType;
|
30 |
import net.brutex.xservices.types.AttachmentType;
|
33 |
import net.brutex.xservices.types.FileResource;
|
31 |
import net.brutex.xservices.types.FileResource;
|
34 |
import net.brutex.xservices.types.FileSetResource;
|
32 |
import net.brutex.xservices.types.FileSetResource;
|
35 |
import net.brutex.xservices.types.ReplacePattern;
|
33 |
import net.brutex.xservices.types.ReplacePattern;
|
36 |
import net.brutex.xservices.types.ReturnCode;
|
34 |
import net.brutex.xservices.types.ReturnCode;
|
37 |
import net.brutex.xservices.util.BrutexNamespaces;
|
35 |
import net.brutex.xservices.util.BrutexNamespaces;
|
- |
|
36 |
import net.brutex.xservices.util.XServicesDocumentation;
|
- |
|
37 |
/**
|
38 |
import net.brutex.xservices.util.XServicesDocumentation;
|
38 |
* File related web service operations.
|
- |
|
39 |
*
|
39 |
/**
|
40 |
* @author Brian Rosenberger
|
40 |
* @author Brian Rosenberger
|
41 |
* @since 0.3.0
|
41 |
*
|
42 |
*
|
42 |
*/
|
43 |
*/
|
43 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
44 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
44 |
@WSDLDocumentationCollection(
|
45 |
@WSDLDocumentationCollection(
|
45 |
{
|
46 |
{
|
46 |
@WSDLDocumentation(value = BrutexNamespaces.BRUTEX_COPYRIGHT, placement = WSDLDocumentation.Placement.TOP)
|
47 |
@WSDLDocumentation(value = BrutexNamespaces.BRUTEX_COPYRIGHT, placement = WSDLDocumentation.Placement.TOP)
|
47 |
}
|
48 |
}
|
Line 48... |
Line 49... |
48 |
)
|
49 |
)
|
49 |
public interface FileService {
|
50 |
public interface FileService {
|
50 |
|
51 |
|
51 |
public static final String OPERATION_BASENAME ="basename";
|
52 |
final String OPERATION_BASENAME ="basename";
|
52 |
public static final String OPERATION_DOWNLOADFILE ="downloadFile";
|
53 |
final String OPERATION_DOWNLOADFILE ="downloadFile";
|
53 |
public static final String OPERATION_UPLOADFILE ="uploadFile";
|
54 |
final String OPERATION_UPLOADFILE ="uploadFile";
|
54 |
public static final String OPERATION_COPY ="copy";
|
55 |
final String OPERATION_COPY ="copy";
|
55 |
public static final String OPERATION_COPYFILE ="copyFile";
|
56 |
final String OPERATION_COPYFILE ="copyFile";
|
56 |
public static final String OPERATION_LOADRESOURCE = "loadResource";
|
57 |
final String OPERATION_LOADRESOURCE = "loadResource";
|
57 |
public static final String OPERATION_LOADRESOURCEFROMARCHIVE = "loadResourceFromArchive";
|
58 |
final String OPERATION_LOADRESOURCEFROMARCHIVE = "loadResourceFromArchive";
|
58 |
public static final String OPERATION_ECHOTOFILE = "echoToFile";
|
59 |
final String OPERATION_ECHOTOFILE = "echoToFile";
|
59 |
public static final String OPERATION_CHANGEOWNER = "changeOwner";
|
60 |
final String OPERATION_CHANGEOWNER = "changeOwner";
|
60 |
public static final String OPERATION_CHANGEMODE = "changeMode";
|
61 |
final String OPERATION_CHANGEMODE = "changeMode";
|
61 |
public static final String OPERATION_CHANGEGROUP = "changeGroup";
|
62 |
final String OPERATION_CHANGEGROUP = "changeGroup";
|
- |
|
63 |
final String OPERATION_REPLACEINFILE = "replaceInFile";
|
- |
|
64 |
final String OPERATION_REPLACEINFILE2 = "replaceInFile2";
|
- |
|
65 |
final String OPERATION_REPLACEINFILEREGEX = "replaceInFileRegEx";
|
- |
|
66 |
|
Line 62... |
Line 67... |
62 |
public static final String OPERATION_REPLACEINFILE = "replaceInFile";
|
67 |
final String PARAM_FILE = "file";
|
63 |
public static final String OPERATION_REPLACEINFILE2 = "replaceInFile2";
|
68 |
final String PARAM_ENCODING = "encoding";
|
64 |
public static final String OPERATION_REPLACEINFILEREGEX = "replaceInFileRegEx";
|
69 |
final String PARAM_OVERRIDE = "override";
|
65 |
|
70 |
|
66 |
/**
|
71 |
/**
|
67 |
* @param filename
|
72 |
* @param filename
|
68 |
* @param suffix
|
73 |
* @param suffix
|
69 |
* @return The base name of the given file excluding the suffix.
|
74 |
* @return The base name of the given file excluding the suffix.
|
70 |
*/
|
75 |
*/
|
71 |
@WSDLDocumentation(value = "The base name of the given file excluding the suffix.")
|
76 |
@WSDLDocumentation(value = "The base name of the given file excluding the suffix.")
|
Line 72... |
Line 77... |
72 |
@WebMethod(operationName = OPERATION_BASENAME)
|
77 |
@WebMethod(operationName = OPERATION_BASENAME)
|
73 |
public abstract String basename(
|
78 |
public abstract String basename(
|
74 |
@WebParam(name = "file") @XmlElement(required=true) String filename,
|
79 |
@WebParam(name = PARAM_FILE) @XmlElement(required=true) String filename,
|
Line 90... |
Line 95... |
90 |
* @throws XServicesFault
|
95 |
* @throws XServicesFault
|
91 |
*/
|
96 |
*/
|
92 |
@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_UPLOADFILE)
|
97 |
@WSDLDocumentation(XServicesDocumentation.SERVICE_OPERATION_UPLOADFILE)
|
93 |
@WebMethod(operationName = OPERATION_UPLOADFILE)
|
98 |
@WebMethod(operationName = OPERATION_UPLOADFILE)
|
94 |
public abstract String uploadFile(
|
99 |
public abstract String uploadFile(
|
95 |
@WebParam(name = "file") AttachmentType file) throws XServicesFault;
|
100 |
@WebParam(name = PARAM_FILE) AttachmentType file) throws XServicesFault;
|
Line 96... |
Line 101... |
96 |
|
101 |
|
97 |
/**
|
102 |
/**
|
98 |
* @param src
|
103 |
* @param src
|
99 |
* @param todir
|
104 |
* @param todir
|
Line 107... |
Line 112... |
107 |
@WebMethod(operationName = OPERATION_COPY)
|
112 |
@WebMethod(operationName = OPERATION_COPY)
|
108 |
public abstract ReturnCode copy(
|
113 |
public abstract ReturnCode copy(
|
109 |
@WebParam(name = FileSetResource.XML_NAME) @XmlElement(required=true) FileSetResource src,
|
114 |
@WebParam(name = FileSetResource.XML_NAME) @XmlElement(required=true) FileSetResource src,
|
110 |
@WebParam(name = "todir") @XmlElement(required=true) String todir,
|
115 |
@WebParam(name = "todir") @XmlElement(required=true) String todir,
|
111 |
@WebParam(name = "preservelastmodified") boolean plm,
|
116 |
@WebParam(name = "preservelastmodified") boolean plm,
|
112 |
@WebParam(name = "overwrite") boolean overwrite,
|
117 |
@WebParam(name = PARAM_OVERRIDE) boolean overwrite,
|
113 |
@WebParam(name = "encoding") String encoding) throws XServicesFault;
|
118 |
@WebParam(name = PARAM_ENCODING) String encoding) throws XServicesFault;
|
Line 114... |
Line 119... |
114 |
|
119 |
|
115 |
/**
|
120 |
/**
|
116 |
* @param fromFile
|
121 |
* @param fromFile
|
117 |
* @param tofile
|
122 |
* @param tofile
|
Line 122... |
Line 127... |
122 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPYFILE)
|
127 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_COPYFILE)
|
123 |
@WebMethod(operationName = OPERATION_COPYFILE)
|
128 |
@WebMethod(operationName = OPERATION_COPYFILE)
|
124 |
public abstract ReturnCode copyFile(
|
129 |
public abstract ReturnCode copyFile(
|
125 |
@WebParam(name = "fromFile") @XmlElement(required=true) String fromFile,
|
130 |
@WebParam(name = "fromFile") @XmlElement(required=true) String fromFile,
|
126 |
@WebParam(name = "toFile") @XmlElement(required=true) String tofile,
|
131 |
@WebParam(name = "toFile") @XmlElement(required=true) String tofile,
|
127 |
@WebParam(name = "overwrite") boolean overwrite) throws XServicesFault;
|
132 |
@WebParam(name = PARAM_OVERRIDE) boolean overwrite) throws XServicesFault;
|
Line 128... |
Line 133... |
128 |
|
133 |
|
129 |
/**
|
134 |
/**
|
130 |
* @param res
|
135 |
* @param res
|
131 |
* @param encoding
|
136 |
* @param encoding
|
Line 134... |
Line 139... |
134 |
*/
|
139 |
*/
|
135 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCE)
|
140 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCE)
|
136 |
@WebMethod(operationName = OPERATION_LOADRESOURCE)
|
141 |
@WebMethod(operationName = OPERATION_LOADRESOURCE)
|
137 |
public abstract String loadRes(
|
142 |
public abstract String loadRes(
|
138 |
@WebParam(name = FileResource.XML_NAME) FileResource res,
|
143 |
@WebParam(name = FileResource.XML_NAME) FileResource res,
|
139 |
@WebParam(name = "encoding") String encoding) throws XServicesFault;
|
144 |
@WebParam(name = PARAM_ENCODING) String encoding) throws XServicesFault;
|
Line 140... |
Line 145... |
140 |
|
145 |
|
141 |
/**
|
146 |
/**
|
142 |
* @param res
|
147 |
* @param res
|
143 |
* @param encoding
|
148 |
* @param encoding
|
Line 146... |
Line 151... |
146 |
*/
|
151 |
*/
|
147 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCEFROMARCHIVE)
|
152 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_LOADRESOURCEFROMARCHIVE)
|
148 |
@WebMethod(operationName = OPERATION_LOADRESOURCEFROMARCHIVE)
|
153 |
@WebMethod(operationName = OPERATION_LOADRESOURCEFROMARCHIVE)
|
149 |
public abstract String loadResFromArchive(
|
154 |
public abstract String loadResFromArchive(
|
150 |
@WebParam(name = "archiveresource") ArchiveResource res,
|
155 |
@WebParam(name = "archiveresource") ArchiveResource res,
|
151 |
@WebParam(name = "encoding") String encoding) throws XServicesFault;
|
156 |
@WebParam(name = PARAM_ENCODING) String encoding) throws XServicesFault;
|
Line 152... |
Line 157... |
152 |
|
157 |
|
153 |
/**
|
158 |
/**
|
154 |
* @param message
|
159 |
* @param message
|
155 |
* @param file
|
160 |
* @param file
|
Line 160... |
Line 165... |
160 |
*/
|
165 |
*/
|
161 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_ECHOTOFILE)
|
166 |
@WSDLDocumentation(value = XServicesDocumentation.SERVICE_OPERATION_ECHOTOFILE)
|
162 |
@WebMethod(operationName = OPERATION_ECHOTOFILE)
|
167 |
@WebMethod(operationName = OPERATION_ECHOTOFILE)
|
163 |
public abstract ReturnCode echo2file(
|
168 |
public abstract ReturnCode echo2file(
|
164 |
@WebParam(name = "message") @XmlElement(required=true) String message,
|
169 |
@WebParam(name = "message") @XmlElement(required=true) String message,
|
165 |
@WebParam(name = "file") @XmlElement(required=true) String file,
|
170 |
@WebParam(name = PARAM_FILE) @XmlElement(required=true) String file,
|
166 |
@WebParam(name = "encoding") String encoding,
|
171 |
@WebParam(name = PARAM_ENCODING) String encoding,
|
167 |
@WebParam(name = "append") boolean append) throws XServicesFault;
|
172 |
@WebParam(name = "append") boolean append) throws XServicesFault;
|
Line 168... |
Line 173... |
168 |
|
173 |
|
- |
|
174 |
/**
|
- |
|
175 |
* Changes the owner of a file or all files inside specified directories.
|
169 |
/**
|
176 |
* Right now it has effect only under Unix/ Linux as it is implemented through
|
- |
|
177 |
* the 'chown' command.
|
- |
|
178 |
*
|
170 |
* @param res
|
179 |
* @param res Collection of files/ directories
|
171 |
* @param owner
|
180 |
* @param owner Identifier of the new owner
|
172 |
* @return
|
181 |
* @return
|
173 |
*/
|
182 |
*/
|
174 |
@WebMethod(operationName = OPERATION_CHANGEOWNER)
|
183 |
@WebMethod(operationName = OPERATION_CHANGEOWNER)
|
175 |
public abstract ReturnCode changeOwner(
|
184 |
public abstract ReturnCode changeOwner(
|
176 |
@WebParam(name = FileSetResource.XML_NAME) FileSetResource res,
|
185 |
@WebParam(name = FileSetResource.XML_NAME) FileSetResource res,
|
Line 177... |
Line 186... |
177 |
@WebParam(name = "owner") @XmlElement(required=true) String owner);
|
186 |
@WebParam(name = "owner") @XmlElement(required=true) String owner);
|
- |
|
187 |
|
- |
|
188 |
/**
|
178 |
|
189 |
* Changes the group owner of a file or all files inside specified directories.
|
- |
|
190 |
* Right now it has effect only under Unix/ Linux as it is implemented through
|
- |
|
191 |
* the 'chgrp' command.
|
179 |
/**
|
192 |
*
|
180 |
* @param res
|
193 |
* @param res Collection of files/ directories
|
181 |
* @param group
|
194 |
* @param group Identifier of the new group owner
|
182 |
* @return
|
195 |
* @return
|
183 |
*/
|
196 |
*/
|
184 |
@WebMethod(operationName = OPERATION_CHANGEGROUP)
|
197 |
@WebMethod(operationName = OPERATION_CHANGEGROUP)
|