Package java.io

Examples of java.io.FileOutputStream


        if (!_metadataFolder.exists()) {
          _metadataFolder.create(true, true, new NullProgressMonitor())
          _metadataFile = _metadataFolder.getFile(_tmlFile.getName().substring(0, _tmlFile.getName().length() - _tmlFile.getFileExtension().length()) + "metadata.xml");
        }

        writer = new OutputStreamWriter(new FileOutputStream(_metadataFile.getLocation().toFile()), _fileEncoding);
        xstream.toXML(metaData, writer);
       
      } catch (CoreException e) {
        IOException ioe = new IOException("Unable to save metadata file '" + _metadataFile.getLocation() + "'.");
        ioe.setStackTrace(e.getStackTrace());
View Full Code Here


   * @throws IOException Something went wrong when writing out the license
   * file. It could be anything, full disk, permissions, etc...
   */
  private static final void writeLicenseFileToDisk(byte[] encryptedLicenseFile, File centraViewLicenseFile) throws IOException
  {
    FileOutputStream fileOutputStream = new FileOutputStream(centraViewLicenseFile);
    try {
      fileOutputStream.write(encryptedLicenseFile);
      fileOutputStream.flush();
    } finally {
      fileOutputStream.close();
    }
  }
View Full Code Here

   
    private void saveMementoToFile(XMLMemento memento) {
        File stateFile = getWorkingSetMemento();
        if (stateFile != null) {
            try {
                FileOutputStream stream = new FileOutputStream(stateFile);
                OutputStreamWriter writer = new OutputStreamWriter(stream, "utf-8"); //$NON-NLS-1$
                memento.save(writer);
                writer.close();
            }
            catch (IOException e) {
View Full Code Here

    catch(Exception e){
    }
  }

  public void writePublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{
    FileOutputStream fos=new FileOutputStream(name);
    writePublicKey(fos, comment);
    fos.close();
  }
View Full Code Here

    catch(Exception e){
    }
  }

  public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{
    FileOutputStream fos=new FileOutputStream(name);
    writeSECSHPublicKey(fos, comment);
    fos.close();
  }
View Full Code Here

    fos.close();
  }


  public void writePrivateKey(String name) throws java.io.FileNotFoundException, java.io.IOException{
    FileOutputStream fos=new FileOutputStream(name);
    writePrivateKey(fos);
    fos.close();
  }
View Full Code Here

                if (!logPropertiesFile.exists()) {
                    logPropertiesFile.createNewFile();

                    // copy from initial properties file from classpath
                    InputStream in = getClass().getResourceAsStream("/log4j.properties");
                    OutputStream out = new FileOutputStream(logPropertiesFile);
                    byte[] buf = new byte[1024];
                    int len;
                    while ((len = in.read(buf)) > 0) {
                        out.write(buf, 0, len);
                    }
                    in.close();
                    out.close();
                }
            } catch (IOException ex) {
                Logger.getLogger(ApplicationSettings.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
View Full Code Here

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);
                XmlExport exporter = new XmlExport(dataPool,
                        settings, new FileOutputStream(f.getAbsoluteFile()));

                exporter.doWork();
                bar.getProgressMonitor().worked(100);
            }
        };
View Full Code Here

            settingsElement.addElement(entry.getKey()).
                    addAttribute("class", clazz.getName()).
                    setText(w.toString(entry.getValue()));
        }

        XMLWriter output = new XMLWriter(new FileOutputStream(xmlFile), new OutputFormat("  ", true));
        output.write(document);
        output.close();
    }
View Full Code Here

                if (!file.createNewFile()) {
                    return;
                }
            }
            if (file.canWrite()) {
                FileOutputStream output = new FileOutputStream(file);
                toolWindowManager.getPersistenceDelegate().save(output);

                output.close();
                //logger.info("Successfully saved layout.");
                logger.info("Saved " + contentManager.getContentCount() + " view(s).");
            }
        }
    }
View Full Code Here

TOP

Related Classes of java.io.FileOutputStream

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.