Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 17th, 2011  |  syntax: Java  |  size: 0.42 KB  |  views: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         protected void writeResource(ByteArrayOutputStream baos, String fileName){
  2.                 ByteArrayInputStream input=new ByteArrayInputStream(baos.toByteArray());
  3.                 IPath path=this.currentPath.removeLastSegments(1).append(fileName);
  4.                 IFile file=this.currentProject.getFile(path);
  5.                 try {
  6.                         file.create(input, IResource.FORCE, null);
  7.                 }catch(CoreException ce){
  8.                         System.out.println(ce.getMessage());
  9.                         ce.printStackTrace();
  10.                 }
  11.         }
  12.  
  13.  
clone this paste RAW Paste Data