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, boolean create) throws XServicesFault { |
boolean append) throws XServicesFault { |
|
Echo echo = new Echo(); |
echo.setTaskName("toFile"); |
292,10 → 292,9 |
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()); |
|
306,7 → 305,7 |
} catch (BuildException e) { |
throw new XServicesFault("Error in echo2file.", e); |
} catch (IOException e) { |
throw new XServicesFault("Cannot write to file." + e.getMessage(), e); |
throw new XServicesFault("Cannot write to file.", e); |
} |
} |
|