Package java.io

Examples of java.io.FileOutputStream


        String on = sform.getFile().getFileName();
        String ext = (on.indexOf(".")!=-1)?on.substring(on.indexOf(".")+1):"res";           
        String fileName = sform.getName()+"."+ext;
       
        File ofile = new File( tresources, fileName );
        FileOutputStream fos = new FileOutputStream(ofile);
        fos.write(sform.getFile().getFileData());
       
        // clean the form
        sform.setName("");
       
        // Forward to the next page
View Full Code Here


            File tempDir = createTempDirectory("teiid-deploy-content", null, getServerTempDirectory());

            //The userSpecifiedName is used in case we renamed the file to add version.
            File contentCopy = new File(tempDir, userSpecifedName);

            os = new BufferedOutputStream(new FileOutputStream(contentCopy));
            ContentContext contentContext = resourceContext.getContentContext();
            ContentServices contentServices = contentContext.getContentServices();
            contentServices.downloadPackageBitsForChildResource(contentContext, resourceType.getName(), key, os);

            return contentCopy;
View Full Code Here

      log.trace("saveAttachment, attachmentsStore=" + attachmentsStore + ", attachment=" + attachment); //$NON-NLS-1$ //$NON-NLS-2$
    }
   
    ObjectOutputStream oos = null;
    try {
      oos = new ObjectOutputStream(new FileOutputStream(attachmentsStore));
      oos.writeObject(attachment);
    } finally {
      if (oos != null) {
        oos.close();
      }
View Full Code Here

          FileUtils.write(configStr.getBytes(), config);
          manifest.delete();
        }
        transformConfig(config, "/vdb.xsl", new StreamResult(new File(metainf, "vdb.xml")));
        config.delete();
        FileOutputStream out = new FileOutputStream(new File(file.getParent(), fileName + "_70.vdb"));
        ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(out));
        int parentLength = dir.getPath().length();
        addDirectory(dir, zos, parentLength);
        zos.close();
      } finally {
View Full Code Here

    String filename = url2Filename(doc.getURL());
    if (doc.getContent().length >= minFileSize) {
      try {
    createDirs(filename);
    BufferedOutputStream os =
      new BufferedOutputStream(new FileOutputStream(filename));
    os.write(doc.getContent());
    os.flush();
    os.close();
      } catch (IOException e) {
    throw new DocManagerException(e.getMessage());
View Full Code Here

      }
      int returnVal = m_FileChooser.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
  File sFile = m_FileChooser.getSelectedFile();
  try {
    ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
    oo.writeObject(object);
    oo.close();
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this,
          "Couldn't write to file: "
View Full Code Here

      }
    }

    // Save the classifier if an object output file is provided
    if (objectOutputFileName.length() != 0) {
      OutputStream os = new FileOutputStream(objectOutputFileName);
      // binary
      if (!(objectOutputFileName.endsWith(".xml") || (objectOutputFileName.endsWith(".koml") && KOML.isPresent()))) {
        if (objectOutputFileName.endsWith(".gz")) {
          os = new GZIPOutputStream(os);
        }
View Full Code Here

      // Check if jbossws-cxf.xml is present, and if so, updated the provider implementation class attribute
      File f=new File(builder.getWebInf(), "jbossws-cxf.xml");
     
      if (f.exists()) {
        FileInputStream fis=null;
        FileOutputStream fos=null;
       
        try {
          fis=new FileInputStream(f);
         
          byte[] b=new byte[fis.available()];
          fis.read(b);
         
          String str=new String(b);
         
          fis.close();
          fis = null;
         
          if (str.indexOf("@provider@") != -1) {
            fos=new FileOutputStream(f);
           
            str = str.replaceAll("@provider@", provider.getClass().getName());
           
            fos.write(str.getBytes());
           
            fos.flush();
            fos.close();
           
            fos = null;
          } else {
            // Report error
            System.err.println("jbossws-cxf.xml file does not contain @provider@ field");
          }
         
        } catch (IOException e) {
          throw new RuntimeException("Failed to copy files", e);
        } finally {
          try {
            if (fis != null) fis.close();
          } catch (IOException e) {
          }
          try {
            if (fos != null) fos.close();
          } catch (IOException e) {
          }
        }
      }     
  }
View Full Code Here

        // temp. filename
        tempFile = File.createTempFile("arffviewer", null);
        tempFile.deleteOnExit();
       
        // serialize instances
        oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(tempFile)));
        oos.writeObject(getInstances());
        oos.flush();
        oos.close();
       
        // add to undo list
View Full Code Here

        if (ze.isDirectory()) {
          new File(cacheDir, ze.getName()).mkdir();
          continue;
        }
        BufferedOutputStream bo =
          new BufferedOutputStream(new FileOutputStream(new File(cacheDir, ze.getName())));
        while (true) {
          int amountRead = zis.read(buff);
          if (amountRead == -1) {
            break;
          }
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.