Subversion Repositories XServices

Rev

Rev 65 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 70
Line 62... Line 62...
62
	 * (non-Javadoc)
62
	 * (non-Javadoc)
63
	 * 
63
	 * 
64
	 * @see net.brutex.xservices.ws.impl.FileService#basename(java.lang.String,
64
	 * @see net.brutex.xservices.ws.impl.FileService#basename(java.lang.String,
65
	 * java.lang.String)
65
	 * java.lang.String)
66
	 */
66
	 */
67
	@Override
67
	
68
	public String basename(String filename, String suffix) {
68
	public String basename(String filename, String suffix) {
69
		final String BASENAME_VALUE = "basename.value";
69
		final String BASENAME_VALUE = "basename.value";
70
		Basename basename = new Basename();
70
		Basename basename = new Basename();
71
		RunTask runner = new RunTask(basename);
71
		RunTask runner = new RunTask(basename);
72
		basename.setFile(new File(filename));
72
		basename.setFile(new File(filename));
Line 137... Line 137...
137
	 * 
137
	 * 
138
	 * @see
138
	 * @see
139
	 * net.brutex.xservices.ws.impl.FileService#base64Encode(net.brutex.xservices
139
	 * net.brutex.xservices.ws.impl.FileService#base64Encode(net.brutex.xservices
140
	 * .types.FileSetResource)
140
	 * .types.FileSetResource)
141
	 */
141
	 */
142
	@Override
142
	
143
	public AttachmentType downloadFile(FileResource res) throws XServicesFault {
143
	public AttachmentType downloadFile(FileResource res) throws XServicesFault {
144
		InputStream is = null;
144
		InputStream is = null;
145
		try {
145
		try {
146
			is = res.getAntResource(null).getInputStream();
146
			is = res.getAntResource(null).getInputStream();
147
			StreamDataSource ssource = new StreamDataSource(
147
			StreamDataSource ssource = new StreamDataSource(
Line 161... Line 161...
161
	 * 
161
	 * 
162
	 * @see
162
	 * @see
163
	 * net.brutex.xservices.ws.impl.FileService#base64Decode(net.brutex.xservices
163
	 * net.brutex.xservices.ws.impl.FileService#base64Decode(net.brutex.xservices
164
	 * .types.AttachmentType)
164
	 * .types.AttachmentType)
165
	 */
165
	 */
166
	@Override
166
	
167
	public String uploadFile(AttachmentType file) throws XServicesFault {
167
	public String uploadFile(AttachmentType file) throws XServicesFault {
168
		DataHandler h = file.getContent();
168
		DataHandler h = file.getContent();
169
		File f = new File(file.getFilename());
169
		File f = new File(file.getFilename());
170
		FileOutputStream fout;
170
		FileOutputStream fout;
171
		try {
171
		try {
Line 186... Line 186...
186
	 * 
186
	 * 
187
	 * @see
187
	 * @see
188
	 * net.brutex.xservices.ws.impl.FileService#copy(net.brutex.xservices.types
188
	 * net.brutex.xservices.ws.impl.FileService#copy(net.brutex.xservices.types
189
	 * .FileSetResource, java.lang.String, boolean, boolean, java.lang.String)
189
	 * .FileSetResource, java.lang.String, boolean, boolean, java.lang.String)
190
	 */
190
	 */
191
	@Override
191
	
192
	public ReturnCode copy(FileSetResource src, String todir, boolean plm,
192
	public ReturnCode copy(FileSetResource src, String todir, boolean plm,
193
			boolean overwrite, String encoding) throws XServicesFault {
193
			boolean overwrite, String encoding) throws XServicesFault {
194
		Copy copy = new Copy();
194
		Copy copy = new Copy();
195
		copy.setTaskName("Copy");
195
		copy.setTaskName("Copy");
196
		RunTask runner = new RunTask(copy);
196
		RunTask runner = new RunTask(copy);
Line 211... Line 211...
211
			copy.setOutputEncoding(System.getProperty("file.encoding"));
211
			copy.setOutputEncoding(System.getProperty("file.encoding"));
212
		}
212
		}
213
		return runner.postTask();
213
		return runner.postTask();
214
	}
214
	}
Line 215... Line 215...
215
 
215
 
216
	@Override
216
	
217
	public ReturnCode copyFile(String fromFile, String tofile, boolean overwrite)
217
	public ReturnCode copyFile(String fromFile, String tofile, boolean overwrite)
218
			throws XServicesFault {
218
			throws XServicesFault {
219
		Copy copy = new Copy();
219
		Copy copy = new Copy();
220
		copy.setTaskName("Copy");
220
		copy.setTaskName("Copy");
Line 233... Line 233...
233
	 * 
233
	 * 
234
	 * @see
234
	 * @see
235
	 * net.brutex.xservices.ws.impl.FileService#loadRes(net.brutex.xservices
235
	 * net.brutex.xservices.ws.impl.FileService#loadRes(net.brutex.xservices
236
	 * .types.FileResource, java.lang.String)
236
	 * .types.FileResource, java.lang.String)
237
	 */
237
	 */
238
	@Override
238
	
239
	public String loadRes(FileResource res, String encoding)
239
	public String loadRes(FileResource res, String encoding)
240
			throws XServicesFault {
240
			throws XServicesFault {
241
		if (encoding == null || encoding.equals("")) {
241
		if (encoding == null || encoding.equals("")) {
242
			encoding = System.getProperty("file.encoding");
242
			encoding = System.getProperty("file.encoding");
243
		}
243
		}
Line 257... Line 257...
257
	 * 
257
	 * 
258
	 * @see
258
	 * @see
259
	 * net.brutex.xservices.ws.impl.FileService#loadResFromArchive(net.brutex
259
	 * net.brutex.xservices.ws.impl.FileService#loadResFromArchive(net.brutex
260
	 * .xservices.types.ArchiveResource, java.lang.String)
260
	 * .xservices.types.ArchiveResource, java.lang.String)
261
	 */
261
	 */
262
	@Override
262
	
263
	public String loadResFromArchive(ArchiveResource res, String encoding) {
263
	public String loadResFromArchive(ArchiveResource res, String encoding) {
264
		if (encoding == null || encoding.equals("")) {
264
		if (encoding == null || encoding.equals("")) {
265
			encoding = System.getProperty("file.encoding");
265
			encoding = System.getProperty("file.encoding");
266
		}
266
		}
267
		LoadResource lr = new LoadResource();
267
		LoadResource lr = new LoadResource();
Line 280... Line 280...
280
	 * (non-Javadoc)
280
	 * (non-Javadoc)
281
	 * 
281
	 * 
282
	 * @see net.brutex.xservices.ws.impl.FileService#echo2file(java.lang.String,
282
	 * @see net.brutex.xservices.ws.impl.FileService#echo2file(java.lang.String,
283
	 * java.lang.String, java.lang.String, boolean)
283
	 * java.lang.String, java.lang.String, boolean)
284
	 */
284
	 */
285
	@Override
285
	
286
	public ReturnCode echo2file(String message, String file, String encoding,
286
	public ReturnCode echo2file(String message, String file, String encoding,
287
			boolean append) throws XServicesFault {
287
			boolean append) throws XServicesFault {
Line 288... Line 288...
288
 
288
 
289
		Echo echo = new Echo();
289
		Echo echo = new Echo();
Line 314... Line 314...
314
	 * 
314
	 * 
315
	 * @see
315
	 * @see
316
	 * net.brutex.xservices.ws.impl.FileService#changeOwner(net.brutex.xservices
316
	 * net.brutex.xservices.ws.impl.FileService#changeOwner(net.brutex.xservices
317
	 * .types.FileSetResource, java.lang.String)
317
	 * .types.FileSetResource, java.lang.String)
318
	 */
318
	 */
319
	@Override
319
	
320
	public ReturnCode changeOwner(FileSetResource res, String owner) {
320
	public ReturnCode changeOwner(FileSetResource res, String owner) {
321
		Chown chown = new Chown();
321
		Chown chown = new Chown();
322
		chown.setTaskName("Chown");
322
		chown.setTaskName("Chown");
323
		RunTask runner = new RunTask(chown);
323
		RunTask runner = new RunTask(chown);
324
		chown.setOwner(owner);
324
		chown.setOwner(owner);
Line 333... Line 333...
333
	 * 
333
	 * 
334
	 * @see
334
	 * @see
335
	 * net.brutex.xservices.ws.impl.FileService#changeGroup(net.brutex.xservices
335
	 * net.brutex.xservices.ws.impl.FileService#changeGroup(net.brutex.xservices
336
	 * .types.FileSetResource, java.lang.String)
336
	 * .types.FileSetResource, java.lang.String)
337
	 */
337
	 */
338
	@Override
338
	
339
	public ReturnCode changeGroup(FileSetResource res, String group) {
339
	public ReturnCode changeGroup(FileSetResource res, String group) {
340
		Chgrp chgrp = new Chgrp();
340
		Chgrp chgrp = new Chgrp();
341
		chgrp.setTaskName("Chgrp");
341
		chgrp.setTaskName("Chgrp");
342
		RunTask runner = new RunTask(chgrp);
342
		RunTask runner = new RunTask(chgrp);
343
		chgrp.setGroup(group);
343
		chgrp.setGroup(group);
Line 352... Line 352...
352
	 * 
352
	 * 
353
	 * @see
353
	 * @see
354
	 * net.brutex.xservices.ws.impl.FileService#changeMode(net.brutex.xservices
354
	 * net.brutex.xservices.ws.impl.FileService#changeMode(net.brutex.xservices
355
	 * .types.FileSetResource, java.lang.String)
355
	 * .types.FileSetResource, java.lang.String)
356
	 */
356
	 */
357
	@Override
357
	
358
	public ReturnCode changeMode(FileSetResource res, String perm) {
358
	public ReturnCode changeMode(FileSetResource res, String perm) {
359
		Chmod chmod = new Chmod();
359
		Chmod chmod = new Chmod();
360
		chmod.setTaskName("Chmod");
360
		chmod.setTaskName("Chmod");
361
		RunTask runner = new RunTask(chmod);
361
		RunTask runner = new RunTask(chmod);
362
		FileSet set = res.getAntResource(chmod.getProject());
362
		FileSet set = res.getAntResource(chmod.getProject());