Subversion Repositories XServices

Compare Revisions

Regard whitespace Rev 97 → Rev 163

/xservices/trunk/src/java/net/brutex/xservices/ws/impl/FileServiceImpl.java
27,12 → 27,12
import javax.jws.WebParam;
import javax.jws.WebService;
 
import net.brutex.xservices.types.ArchiveResource;
import net.brutex.xservices.types.AttachmentType;
import net.brutex.xservices.types.FileResource;
import net.brutex.xservices.types.FileSetResource;
import net.brutex.xservices.types.ReplacePattern;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.types.ant.ArchiveResource;
import net.brutex.xservices.types.ant.AttachmentType;
import net.brutex.xservices.types.ant.FileResource;
import net.brutex.xservices.types.ant.FileSetResource;
import net.brutex.xservices.util.BrutexNamespaces;
import net.brutex.xservices.util.RunTask;
import net.brutex.xservices.ws.FileService;
284,7 → 284,7
*/
public ReturnCode echo2file(String message, String file, String encoding,
boolean append) throws XServicesFault {
boolean append, boolean create) throws XServicesFault {
 
Echo echo = new Echo();
echo.setTaskName("toFile");
292,9 → 292,10
echo.addText(message);
echo.setEncoding(encoding);
File f = new File(file);
 
try {
if(!f.exists() && create) f.createNewFile();
if (!f.canWrite())
 
throw new XServicesFault("Cannot write to file: "
+ f.getCanonicalPath());
 
305,7 → 306,7
} catch (BuildException e) {
throw new XServicesFault("Error in echo2file.", e);
} catch (IOException e) {
throw new XServicesFault("Cannot write to file.", e);
throw new XServicesFault("Cannot write to file." + e.getMessage(), e);
}
}