diff options
author | aclement <aclement> | 2006-05-18 08:05:39 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-05-18 08:05:39 +0000 |
commit | bf5c6b8b011fa305ec446e1e9ff5c45ef64f8814 (patch) | |
tree | 58a7d47f589be240503099054925f80ddf4ed966 /org.aspectj.ajdt.core/src/org | |
parent | 3d92cc4e889d0c8326eb237001449f8fd1d6a591 (diff) | |
download | aspectj-bf5c6b8b011fa305ec446e1e9ff5c45ef64f8814.tar.gz aspectj-bf5c6b8b011fa305ec446e1e9ff5c45ef64f8814.zip |
fix for 138171 - error if we can't copy a resource over rather than crashing.
Diffstat (limited to 'org.aspectj.ajdt.core/src/org')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index a6fbe2970..cda98088d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -18,6 +18,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; @@ -505,10 +506,18 @@ public class AjBuildManager implements IOutputClassFileNameProvider,IBinarySourc if (buildConfig.getCompilationResultDestinationManager() != null) { destDir = buildConfig.getCompilationResultDestinationManager().getOutputLocationForResource(srcLocation.getAbsolutePath()); } - OutputStream fos = - FileUtil.makeOutputStream(new File(destDir,filename)); - fos.write(content); - fos.close(); + try { + OutputStream fos = + FileUtil.makeOutputStream(new File(destDir,filename)); + fos.write(content); + fos.close(); + } catch (FileNotFoundException fnfe) { + IMessage msg = new Message("unable to copy resource to output folder: '" + filename + "' - reason: "+fnfe.getMessage(), + IMessage.ERROR, + null, + new SourceLocation(srcLocation,0)); + handler.handleMessage(msg); + } } state.recordResource(filename); } |