Subversion Repositories XServices

Rev

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

Rev 54 Rev 60
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.impl;
16
package net.brutex.xservices.ws.impl;
17
 
17
 
18
import java.io.File;
18
import java.io.File;
19
import java.io.FileInputStream;
19
import java.io.FileInputStream;
20
import java.io.FileNotFoundException;
20
import java.io.FileNotFoundException;
21
import java.io.FileOutputStream;
21
import java.io.FileOutputStream;
22
import java.io.IOException;
22
import java.io.IOException;
23
import java.io.InputStream;
23
import java.io.InputStream;
24
import java.io.UnsupportedEncodingException;
24
import java.io.UnsupportedEncodingException;
25
import java.util.List;
25
import java.util.List;
26
 
26
 
27
import javax.activation.DataHandler;
27
import javax.activation.DataHandler;
28
import javax.jws.WebMethod;
28
import javax.jws.WebMethod;
29
import javax.jws.WebParam;
29
import javax.jws.WebParam;
30
import javax.jws.WebService;
30
import javax.jws.WebService;
31
 
31
 
32
import net.brutex.xservices.types.AntProperty;
32
import net.brutex.xservices.types.AntProperty;
33
import net.brutex.xservices.types.ArchiveResource;
33
import net.brutex.xservices.types.ArchiveResource;
34
import net.brutex.xservices.types.AttachmentType;
34
import net.brutex.xservices.types.AttachmentType;
35
import net.brutex.xservices.types.FileResource;
35
import net.brutex.xservices.types.FileResource;
36
import net.brutex.xservices.types.FileSetResource;
36
import net.brutex.xservices.types.FileSetResource;
37
import net.brutex.xservices.types.ResourceInterface;
37
import net.brutex.xservices.types.ResourceInterface;
38
import net.brutex.xservices.types.ReturnCode;
38
import net.brutex.xservices.types.ReturnCode;
39
import net.brutex.xservices.util.BrutexNamespaces;
39
import net.brutex.xservices.util.BrutexNamespaces;
40
import net.brutex.xservices.util.RunTask;
40
import net.brutex.xservices.util.RunTask;
41
import net.brutex.xservices.ws.FileService;
41
import net.brutex.xservices.ws.FileService;
42
import net.brutex.xservices.ws.XServicesFault;
42
import net.brutex.xservices.ws.XServicesFault;
43
 
43
 
44
import org.apache.commons.codec.binary.Base64;
44
import org.apache.commons.codec.binary.Base64;
45
import org.apache.commons.codec.binary.Base64InputStream;
45
import org.apache.commons.codec.binary.Base64InputStream;
46
import org.apache.cxf.aegis.type.mtom.StreamDataSource;
46
import org.apache.cxf.aegis.type.mtom.StreamDataSource;
47
import org.apache.tools.ant.BuildException;
47
import org.apache.tools.ant.BuildException;
48
import org.apache.tools.ant.taskdefs.Basename;
48
import org.apache.tools.ant.taskdefs.Basename;
49
import org.apache.tools.ant.taskdefs.Chmod;
49
import org.apache.tools.ant.taskdefs.Chmod;
50
import org.apache.tools.ant.taskdefs.Copy;
50
import org.apache.tools.ant.taskdefs.Copy;
51
import org.apache.tools.ant.taskdefs.Echo;
51
import org.apache.tools.ant.taskdefs.Echo;
52
import org.apache.tools.ant.taskdefs.LoadResource;
52
import org.apache.tools.ant.taskdefs.LoadResource;
53
import org.apache.tools.ant.taskdefs.optional.unix.Chgrp;
53
import org.apache.tools.ant.taskdefs.optional.unix.Chgrp;
54
import org.apache.tools.ant.taskdefs.optional.unix.Chown;
54
import org.apache.tools.ant.taskdefs.optional.unix.Chown;
55
import org.apache.tools.ant.types.FileSet;
55
import org.apache.tools.ant.types.FileSet;
56
 
56
 
57
/**
57
/**
58
 * 
58
 * 
59
 * @author Brian Rosenberger, bru@brutex.de
59
 * @author Brian Rosenberger, bru@brutex.de
60
 */
60
 */
61
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES, endpointInterface = "net.brutex.xservices.ws.FileService", serviceName = "FileService")
61
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES, endpointInterface = "net.brutex.xservices.ws.FileService", serviceName = "FileService")
62
public class FileServiceImpl implements FileService {
62
public class FileServiceImpl implements FileService {
63
 
63
 
64
	/*
64
	/*
65
	 * (non-Javadoc)
65
	 * (non-Javadoc)
66
	 * 
66
	 * 
67
	 * @see net.brutex.xservices.ws.impl.FileService#basename(java.lang.String,
67
	 * @see net.brutex.xservices.ws.impl.FileService#basename(java.lang.String,
68
	 * java.lang.String)
68
	 * java.lang.String)
69
	 */
69
	 */
70
	@Override
70
	@Override
71
	@WebMethod(operationName = "basename")
71
	@WebMethod(operationName = "basename")
72
	public ReturnCode basename(@WebParam(name = "file") String filename,
72
	public ReturnCode basename(@WebParam(name = "file") String filename,
73
			@WebParam(name = "suffix") String suffix) {
73
			@WebParam(name = "suffix") String suffix) {
74
		return basename(new File(filename), suffix);
74
		return basename(new File(filename), suffix);
75
	}
75
	}
76
 
76
 
77
	/*
77
	/*
78
	 * (non-Javadoc)
78
	 * (non-Javadoc)
79
	 * 
79
	 * 
80
	 * @see
80
	 * @see
81
	 * net.brutex.xservices.ws.impl.FileService#base64Encode(net.brutex.xservices
81
	 * net.brutex.xservices.ws.impl.FileService#base64Encode(net.brutex.xservices
82
	 * .types.FileSetResource)
82
	 * .types.FileSetResource)
83
	 */
83
	 */
84
	@Override
84
	@Override
85
	@WebMethod(operationName = "downloadFile")
85
	@WebMethod(operationName = "downloadFile")
86
	public AttachmentType downloadFile(@WebParam(name = "file") FileResource res) {
86
	public AttachmentType downloadFile(@WebParam(name = "file") FileResource res) {
87
		InputStream is = null;
87
		InputStream is = null;
88
		try {
88
		try {
89
			is = res.getAntResource(null).getInputStream();
89
			is = res.getAntResource(null).getInputStream();
90
		} catch (IOException e) {
90
		} catch (IOException e) {
91
			// TODO Auto-generated catch block
91
			// TODO Auto-generated catch block
92
			e.printStackTrace();
92
			e.printStackTrace();
93
		}
93
		}
94
		DataHandler h = new DataHandler(new StreamDataSource(
94
		DataHandler h = new DataHandler(new StreamDataSource(
95
				"application/binary", is));
95
				"application/binary", is));
96
		AttachmentType t = new AttachmentType();
96
		AttachmentType t = new AttachmentType();
97
		t.setContent(h);
97
		t.setContent(h);
-
 
98
		t.setFilename(res.getAntResource(null).getName());
98
		return t;
99
		return t;
99
	}
100
	}
100
 
101
 
101
	/*
102
	/*
102
	 * (non-Javadoc)
103
	 * (non-Javadoc)
103
	 * 
104
	 * 
104
	 * @see
105
	 * @see
105
	 * net.brutex.xservices.ws.impl.FileService#base64Decode(net.brutex.xservices
106
	 * net.brutex.xservices.ws.impl.FileService#base64Decode(net.brutex.xservices
106
	 * .types.AttachmentType)
107
	 * .types.AttachmentType)
107
	 */
108
	 */
108
	@Override
109
	@Override
109
	@WebMethod(operationName = "uploadFile")
110
	@WebMethod(operationName = "uploadFile")
110
	public String uploadFile(@WebParam(name = "file") AttachmentType file) {
111
	public String uploadFile(@WebParam(name = "file") AttachmentType file) {
111
		DataHandler h =  file.getContent();
112
		DataHandler h =  file.getContent();
112
		File f = new File(file.getFilename());
113
		File f = new File(file.getFilename());
113
		FileOutputStream fout;
114
		FileOutputStream fout;
114
		try {
115
		try {
115
			fout = new FileOutputStream(f);
116
			fout = new FileOutputStream(f);
116
			/*
117
			/*
117
			 * InputStream in = h.getInputStream();
118
			 * InputStream in = h.getInputStream();
118
			int b;
119
			int b;
119
			while( (b=in.read())!= -1 ) {
120
			while( (b=in.read())!= -1 ) {
120
				fout.write(b);
121
				fout.write(b);
121
			}
122
			}
122
			*/
123
			*/
123
			h.writeTo(fout);
124
			h.writeTo(fout);
124
			fout.flush();
125
			fout.flush();
125
			fout.close();
126
			fout.close();
126
			//in.close();
127
			//in.close();
127
		} catch (FileNotFoundException e) {
128
		} catch (FileNotFoundException e) {
128
			throw new BuildException(e);
129
			throw new BuildException(e);
129
		} catch (IOException e) {
130
		} catch (IOException e) {
130
			throw new BuildException(e);
131
			throw new BuildException(e);
131
		}
132
		}
132
		return file.getFilename();
133
		return file.getFilename();
133
	}
134
	}
134
 
135
 
135
	/*
136
	/*
136
	 * (non-Javadoc)
137
	 * (non-Javadoc)
137
	 * 
138
	 * 
138
	 * @see
139
	 * @see
139
	 * net.brutex.xservices.ws.impl.FileService#copy(net.brutex.xservices.types
140
	 * net.brutex.xservices.ws.impl.FileService#copy(net.brutex.xservices.types
140
	 * .FileSetResource, java.lang.String, boolean, boolean, java.lang.String)
141
	 * .FileSetResource, java.lang.String, boolean, boolean, java.lang.String)
141
	 */
142
	 */
142
	@Override
143
	@Override
143
	@WebMethod(operationName = "copy")
144
	@WebMethod(operationName = "copy")
144
	public ReturnCode copy(@WebParam(name = "fileset") FileSetResource src,
145
	public ReturnCode copy(@WebParam(name = "fileset") FileSetResource src,
145
			@WebParam(name = "todir") String todir,
146
			@WebParam(name = "todir") String todir,
146
			@WebParam(name = "preservelastmodified") boolean plm,
147
			@WebParam(name = "preservelastmodified") boolean plm,
147
			@WebParam(name = "overwrite") boolean overwrite,
148
			@WebParam(name = "overwrite") boolean overwrite,
148
			@WebParam(name = "encoding") String encoding) throws XServicesFault {
149
			@WebParam(name = "encoding") String encoding) throws XServicesFault {
149
		return copy(src, new File(todir), plm, overwrite, encoding);
150
		return copy(src, new File(todir), plm, overwrite, encoding);
150
	}
151
	}
151
 
152
 
152
	/*
153
	/*
153
	 * (non-Javadoc)
154
	 * (non-Javadoc)
154
	 * 
155
	 * 
155
	 * @see
156
	 * @see
156
	 * net.brutex.xservices.ws.impl.FileService#loadRes(net.brutex.xservices
157
	 * net.brutex.xservices.ws.impl.FileService#loadRes(net.brutex.xservices
157
	 * .types.FileResource, java.lang.String)
158
	 * .types.FileResource, java.lang.String)
158
	 */
159
	 */
159
	@Override
160
	@Override
160
	@WebMethod(operationName = "loadResource")
161
	@WebMethod(operationName = "loadResource")
161
	public ReturnCode loadRes(@WebParam(name = "resource") FileResource res,
162
	public ReturnCode loadRes(@WebParam(name = "resource") FileResource res,
162
			@WebParam(name = "encoding") String encoding) {
163
			@WebParam(name = "encoding") String encoding) {
163
		if (encoding == null || encoding.equals("")) {
164
		if (encoding == null || encoding.equals("")) {
164
			encoding = System.getProperty("file.encoding");
165
			encoding = System.getProperty("file.encoding");
165
		}
166
		}
166
		return loadResource(res, encoding);
167
		return loadResource(res, encoding);
167
	}
168
	}
168
 
169
 
169
	/*
170
	/*
170
	 * (non-Javadoc)
171
	 * (non-Javadoc)
171
	 * 
172
	 * 
172
	 * @see
173
	 * @see
173
	 * net.brutex.xservices.ws.impl.FileService#loadResFromArchive(net.brutex
174
	 * net.brutex.xservices.ws.impl.FileService#loadResFromArchive(net.brutex
174
	 * .xservices.types.ArchiveResource, java.lang.String)
175
	 * .xservices.types.ArchiveResource, java.lang.String)
175
	 */
176
	 */
176
	@Override
177
	@Override
177
	@WebMethod(operationName = "loadResourceFromArchive")
178
	@WebMethod(operationName = "loadResourceFromArchive")
178
	public ReturnCode loadResFromArchive(
179
	public ReturnCode loadResFromArchive(
179
			@WebParam(name = "archiveresource") ArchiveResource res,
180
			@WebParam(name = "archiveresource") ArchiveResource res,
180
			@WebParam(name = "encoding") String encoding) {
181
			@WebParam(name = "encoding") String encoding) {
181
		if (encoding == null || encoding.equals("")) {
182
		if (encoding == null || encoding.equals("")) {
182
			encoding = System.getProperty("file.encoding");
183
			encoding = System.getProperty("file.encoding");
183
		}
184
		}
184
		return loadResource(res, encoding);
185
		return loadResource(res, encoding);
185
	}
186
	}
186
 
187
 
187
	/*
188
	/*
188
	 * (non-Javadoc)
189
	 * (non-Javadoc)
189
	 * 
190
	 * 
190
	 * @see net.brutex.xservices.ws.impl.FileService#echo2file(java.lang.String,
191
	 * @see net.brutex.xservices.ws.impl.FileService#echo2file(java.lang.String,
191
	 * java.lang.String, java.lang.String, boolean)
192
	 * java.lang.String, java.lang.String, boolean)
192
	 */
193
	 */
193
	@Override
194
	@Override
194
	@WebMethod(operationName = "echoToFile")
195
	@WebMethod(operationName = "echoToFile")
195
	public ReturnCode echo2file(@WebParam(name = "message") String message,
196
	public ReturnCode echo2file(@WebParam(name = "message") String message,
196
			@WebParam(name = "file") String file,
197
			@WebParam(name = "file") String file,
197
			@WebParam(name = "encoding") String encoding,
198
			@WebParam(name = "encoding") String encoding,
198
			@WebParam(name = "append") boolean append) {
199
			@WebParam(name = "append") boolean append) {
199
		return echo(message, new File(file), encoding, append);
200
		return echo(message, new File(file), encoding, append);
200
	}
201
	}
201
 
202
 
202
	/*
203
	/*
203
	 * (non-Javadoc)
204
	 * (non-Javadoc)
204
	 * 
205
	 * 
205
	 * @see
206
	 * @see
206
	 * net.brutex.xservices.ws.impl.FileService#changeOwner(net.brutex.xservices
207
	 * net.brutex.xservices.ws.impl.FileService#changeOwner(net.brutex.xservices
207
	 * .types.FileSetResource, java.lang.String)
208
	 * .types.FileSetResource, java.lang.String)
208
	 */
209
	 */
209
	@Override
210
	@Override
210
	@WebMethod(operationName = "changeOwner")
211
	@WebMethod(operationName = "changeOwner")
211
	public ReturnCode changeOwner(
212
	public ReturnCode changeOwner(
212
			@WebParam(name = "fileset") FileSetResource res,
213
			@WebParam(name = "fileset") FileSetResource res,
213
			@WebParam(name = "owner") String owner) {
214
			@WebParam(name = "owner") String owner) {
214
		return chown(res, owner);
215
		return chown(res, owner);
215
	}
216
	}
216
 
217
 
217
	/*
218
	/*
218
	 * (non-Javadoc)
219
	 * (non-Javadoc)
219
	 * 
220
	 * 
220
	 * @see
221
	 * @see
221
	 * net.brutex.xservices.ws.impl.FileService#changeGroup(net.brutex.xservices
222
	 * net.brutex.xservices.ws.impl.FileService#changeGroup(net.brutex.xservices
222
	 * .types.FileSetResource, java.lang.String)
223
	 * .types.FileSetResource, java.lang.String)
223
	 */
224
	 */
224
	@Override
225
	@Override
225
	@WebMethod(operationName = "changeGroup")
226
	@WebMethod(operationName = "changeGroup")
226
	public ReturnCode changeGroup(
227
	public ReturnCode changeGroup(
227
			@WebParam(name = "fileset") FileSetResource res,
228
			@WebParam(name = "fileset") FileSetResource res,
228
			@WebParam(name = "group") String group) {
229
			@WebParam(name = "group") String group) {
229
		return chgrp(res, group);
230
		return chgrp(res, group);
230
	}
231
	}
231
 
232
 
232
	/*
233
	/*
233
	 * (non-Javadoc)
234
	 * (non-Javadoc)
234
	 * 
235
	 * 
235
	 * @see
236
	 * @see
236
	 * net.brutex.xservices.ws.impl.FileService#changeMode(net.brutex.xservices
237
	 * net.brutex.xservices.ws.impl.FileService#changeMode(net.brutex.xservices
237
	 * .types.FileSetResource, java.lang.String)
238
	 * .types.FileSetResource, java.lang.String)
238
	 */
239
	 */
239
	@Override
240
	@Override
240
	@WebMethod(operationName = "changeMode")
241
	@WebMethod(operationName = "changeMode")
241
	public ReturnCode changeMode(
242
	public ReturnCode changeMode(
242
			@WebParam(name = "fileset") FileSetResource res,
243
			@WebParam(name = "fileset") FileSetResource res,
243
			@WebParam(name = "permissions") String perm) {
244
			@WebParam(name = "permissions") String perm) {
244
		return chmod(res, perm);
245
		return chmod(res, perm);
245
	}
246
	}
246
 
247
 
247
	@WebMethod(exclude = true)
248
	@WebMethod(exclude = true)
248
	private ReturnCode basename(File file, String suffix) {
249
	private ReturnCode basename(File file, String suffix) {
249
		Basename basename = new Basename();
250
		Basename basename = new Basename();
250
		RunTask runner = new RunTask(basename);
251
		RunTask runner = new RunTask(basename);
251
		basename.setFile(file);
252
		basename.setFile(file);
252
		if (suffix != null && !suffix.equals("")) {
253
		if (suffix != null && !suffix.equals("")) {
253
			basename.setSuffix(suffix);
254
			basename.setSuffix(suffix);
254
		}
255
		}
255
		basename.setProperty("basename.value");
256
		basename.setProperty("basename.value");
256
		return runner.postTask();
257
		return runner.postTask();
257
	}
258
	}
258
 
259
 
259
	@WebMethod(exclude = true)
260
	@WebMethod(exclude = true)
260
	private ReturnCode loadResource(ResourceInterface src, String encoding) {
261
	private ReturnCode loadResource(ResourceInterface src, String encoding) {
261
		LoadResource lr = new LoadResource();
262
		LoadResource lr = new LoadResource();
262
		lr.setTaskName("LoadResource");
263
		lr.setTaskName("LoadResource");
263
		RunTask runner = new RunTask(lr);
264
		RunTask runner = new RunTask(lr);
264
		lr.addConfigured(src.getAntResource(lr.getProject()));
265
		lr.addConfigured(src.getAntResource(lr.getProject()));
265
		lr.setEncoding(encoding);
266
		lr.setEncoding(encoding);
266
		System.out.println("Using encoding: " + encoding);
267
		System.out.println("Using encoding: " + encoding);
267
		lr.setProperty("LoadResource.out");
268
		lr.setProperty("LoadResource.out");
268
		return runner.postTask();
269
		return runner.postTask();
269
	}
270
	}
270
 
271
 
271
	@WebMethod(exclude = true)
272
	@WebMethod(exclude = true)
272
	private ReturnCode echo(String msg, File file, String encoding,
273
	private ReturnCode echo(String msg, File file, String encoding,
273
			boolean append) {
274
			boolean append) {
274
		Echo echo = new Echo();
275
		Echo echo = new Echo();
275
		echo.setTaskName("toFile");
276
		echo.setTaskName("toFile");
276
		RunTask runTask = new RunTask(echo);
277
		RunTask runTask = new RunTask(echo);
277
		echo.addText(msg);
278
		echo.addText(msg);
278
		echo.setEncoding(encoding);
279
		echo.setEncoding(encoding);
279
		echo.setFile(file);
280
		echo.setFile(file);
280
		echo.setAppend(append);
281
		echo.setAppend(append);
281
		return runTask.postTask();
282
		return runTask.postTask();
282
	}
283
	}
283
 
284
 
284
	@WebMethod(exclude = true)
285
	@WebMethod(exclude = true)
285
	private ReturnCode copy(FileSetResource src, File dst,
286
	private ReturnCode copy(FileSetResource src, File dst,
286
			boolean preservelastmodified, boolean overwrite, String encoding) {
287
			boolean preservelastmodified, boolean overwrite, String encoding) {
287
		Copy copy = new Copy();
288
		Copy copy = new Copy();
288
		copy.setTaskName("Copy");
289
		copy.setTaskName("Copy");
289
		RunTask runner = new RunTask(copy);
290
		RunTask runner = new RunTask(copy);
290
		FileSet set = src.getAntResource(copy.getProject());
291
		FileSet set = src.getAntResource(copy.getProject());
291
		copy.add(set);
292
		copy.add(set);
292
 
293
 
293
		if (dst.isDirectory()) {
294
		if (dst.isDirectory()) {
294
			copy.setTodir(dst);
295
			copy.setTodir(dst);
295
		}
296
		}
296
		if (dst.isFile()) {
297
		if (dst.isFile()) {
297
			copy.setTofile(dst);
298
			copy.setTofile(dst);
298
		}
299
		}
299
		copy.setOverwrite(overwrite);
300
		copy.setOverwrite(overwrite);
300
		copy.setPreserveLastModified(preservelastmodified);
301
		copy.setPreserveLastModified(preservelastmodified);
301
		if (encoding != null && !encoding.equals("")) {
302
		if (encoding != null && !encoding.equals("")) {
302
			copy.setOutputEncoding(encoding);
303
			copy.setOutputEncoding(encoding);
303
		} else {
304
		} else {
304
			copy.setOutputEncoding(System.getProperty("file.encoding"));
305
			copy.setOutputEncoding(System.getProperty("file.encoding"));
305
		}
306
		}
306
 
307
 
307
		return runner.postTask();
308
		return runner.postTask();
308
	}
309
	}
309
 
310
 
310
	@WebMethod(exclude = true)
311
	@WebMethod(exclude = true)
311
	private ReturnCode chown(FileSetResource src, String owner) {
312
	private ReturnCode chown(FileSetResource src, String owner) {
312
		Chown chown = new Chown();
313
		Chown chown = new Chown();
313
		chown.setTaskName("Chown");
314
		chown.setTaskName("Chown");
314
		RunTask runner = new RunTask(chown);
315
		RunTask runner = new RunTask(chown);
315
		chown.setOwner(owner);
316
		chown.setOwner(owner);
316
		FileSet set = src.getAntResource(chown.getProject());
317
		FileSet set = src.getAntResource(chown.getProject());
317
		chown.add(set);
318
		chown.add(set);
318
		chown.setMaxParallel(300);
319
		chown.setMaxParallel(300);
319
		return runner.postTask();
320
		return runner.postTask();
320
	}
321
	}
321
 
322
 
322
	@WebMethod(exclude = true)
323
	@WebMethod(exclude = true)
323
	private ReturnCode chgrp(FileSetResource src, String group) {
324
	private ReturnCode chgrp(FileSetResource src, String group) {
324
		Chgrp chgrp = new Chgrp();
325
		Chgrp chgrp = new Chgrp();
325
		chgrp.setTaskName("Chgrp");
326
		chgrp.setTaskName("Chgrp");
326
		RunTask runner = new RunTask(chgrp);
327
		RunTask runner = new RunTask(chgrp);
327
		chgrp.setGroup(group);
328
		chgrp.setGroup(group);
328
		FileSet set = src.getAntResource(chgrp.getProject());
329
		FileSet set = src.getAntResource(chgrp.getProject());
329
		chgrp.add(set);
330
		chgrp.add(set);
330
		chgrp.setMaxParallel(300);
331
		chgrp.setMaxParallel(300);
331
		return runner.postTask();
332
		return runner.postTask();
332
	}
333
	}
333
 
334
 
334
	@WebMethod(exclude = true)
335
	@WebMethod(exclude = true)
335
	private ReturnCode chmod(FileSetResource src, String perm) {
336
	private ReturnCode chmod(FileSetResource src, String perm) {
336
		Chmod chmod = new Chmod();
337
		Chmod chmod = new Chmod();
337
		chmod.setTaskName("Chmod");
338
		chmod.setTaskName("Chmod");
338
		RunTask runner = new RunTask(chmod);
339
		RunTask runner = new RunTask(chmod);
339
		FileSet set = src.getAntResource(chmod.getProject());
340
		FileSet set = src.getAntResource(chmod.getProject());
340
		chmod.add(set);
341
		chmod.add(set);
341
		chmod.setMaxParallel(300);
342
		chmod.setMaxParallel(300);
342
		chmod.setPerm(perm);
343
		chmod.setPerm(perm);
343
		chmod.setVerbose(true);
344
		chmod.setVerbose(true);
344
		return runner.postTask();
345
		return runner.postTask();
345
	}
346
	}
346
 
347
 
347
}
348
}