Examples of FileWriter


Examples of Utils.FileWriter

                inProfile.setVisible(true);
                if(inProfile.getResult()==null)
                    return;
                Profile prfMain=new Profile(inProfile.getResult());
                inProfile=null;
                FileWriter fwDBWriter;
                if(!fdCreate.getSelectedFile().exists())
                {
                    if((!fdCreate.getSelectedFile().getName().toLowerCase().endsWith(".vcd"))&&(!(new File(fdCreate.getSelectedFile().getName()+".vcd")).exists()))
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile()+".vcd", prfMain);
                    else
                        fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                else
                {
                    YesNoCancelMessage ynmDelete=new YesNoCancelMessage(mwcMain, mwcMain.getTitle(), "The file already exists would you like to replace it?", false);
                    ynmDelete.setVisible(true);
                    if(ynmDelete.getResult()==YesNoCancelMessage.NO)
                    {
                        ynmDelete=null;
                        fdCreate=null;
                        return;
                    }
                    fwDBWriter=new FileWriter(fdCreate.getSelectedFile(), prfMain);
                }
                if(!fwDBWriter.write(pcPass.getPassword()))
                {
                    OKMessage okError=new OKMessage(mwcMain, "The error occured while writing the file!");
                    okError.setVisible(true);
                    okError=null;
                }
View Full Code Here

Examples of Writers.FileWriter

     * @throws Exception
     */
    public void saveToFile(String filePath) throws FileNotFoundException, IOException, Exception{
        filePath = filePath.toLowerCase();
        setOutputFile(filePath);
        FileWriter writer = null;
        if(filePath.endsWith("csv")){
            writer = new CSVWriter(data, result, outputFile);
        }
        if(filePath.endsWith("xls")){
            writer = new XLSWriter(data, result, outputFile);
        }
        if(filePath.endsWith("wss")){
            writer = new WSSWriter(data, result, outputFile);
        }
        if(filePath.endsWith("pdf")){
            writer = new PDFWriter(data, result, outputFile, pageSetup, coverPage, author, projectDesc);
        }
        if (writer!=null) {
            writer.writeAll();
        }else
            throw new Exception("Unsupported File Format");
    }
View Full Code Here

Examples of com.itstherules.io.FileWriter

    else dur = ((TagStore) tags.get(tags.size() - 1)).getTimestamp();
    return dur;
  }
 
  public void writeTags() {
    FileWriter fw = ioHelper.getFileWriter(flvHeader);
    fw.setDebug(ioHelper.isDebug());
    fw.setTags(tags);
    fw.setInStream(ioHelper.getFileReader().getStream());
    flvHeader.setHasAudio(tagParser.getLastAudioTag() != -1);
    flvHeader.setHasVideo(tagParser.getLastVideoTag() != -1);
    fw.writeTags();
  }
View Full Code Here

Examples of com.stuffwithstuff.magpie.util.FileWriter

  @Def("(is File) writeInt32(is Int)")
  @Doc("Writes the given int to this File.")
  public static class WriteInt implements Intrinsic {
    public Obj invoke(Context context, Obj left, Obj right) {
      FileWriter writer = (FileWriter)left.getValue();
      try {
        writer.writeInt32(right.asInt());
        return right;
      } catch (IOException e) {
        throw context.error("IOError", "Could not write.");
      }
    }
View Full Code Here

Examples of explore.java.concurrency.producer_consumer.FileWriter

        new Main().go();
    }

    void go() {

        final FileWriter task = new FileWriter(queue);
        fileWritingService.submit(task);

        List<CrawlerTask> callables = callables();

        List<ListenableFuture<Map<String, Object>>> futures = Lists.transform(callables, new Function<CrawlerTask,
                                                                                                    ListenableFuture<Map<String, Object>>>() {
            @Override
            public ListenableFuture<Map<String, Object>> apply(CrawlerTask input) {
                return executorService.submit(input);
            }
        });

        ImmutableList.copyOf(Lists.transform(futures, new Function<ListenableFuture<Map<String, Object>>,
                FutureCallback<Map<String, Object>>>() {
            @Override
            public FutureCallback<Map<String, Object>> apply(ListenableFuture<Map<String, Object>> input) {
                ExecutionCallback executionCallback = new ExecutionCallback(queue);
                Futures.addCallback(input, executionCallback);
                return executionCallback;
            }
        }));

        ListenableFuture<List<Map<String, Object>>> listListenableFuture = Futures.successfulAsList(futures);
        Futures.addCallback(listListenableFuture, new FutureCallback<List<Map<String, Object>>>() {
            @Override
            public void onSuccess(List<Map<String, Object>> result) {
                task.finished();
                executorService.shutdown();
                fileWritingService.shutdown();
            }

            @Override
View Full Code Here

Examples of jFileLib.text.FileWriter

            }
           
            lines.add("");
        }
       
      FileWriter writer = new FileWriter(getFilePath());
     
        return writer.writeLinesToFile(lines);
    }
View Full Code Here

Examples of java.io.FileWriter

    Class[] classes = { TranslatorMetaDataGroup.class };
    JAXBContext context = JAXBContext.newInstance(classes);
    Marshaller marshaller = context.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,new Boolean(true));

    FileWriter fw = null;
    try {
      fw = new FileWriter(dsXml);
      marshaller.marshal(group, fw);
    } finally {
      if (fw != null) {
        fw.close();
      }
    }
  }
View Full Code Here

Examples of java.io.FileWriter

    WebRobot robby = new WebRobot();
    robby.setStartURL(new URL("http://www.matuschek.net"));
    robby.setMaxDepth(1);
    robby.setSleepTime(0);

    FileWriter logfile = new FileWriter("urls.txt");
    URLLogger log = new URLLogger(logfile);
    robby.setDocManager(log);

    robby.run();
    logfile.close();
  }
View Full Code Here

Examples of java.io.FileWriter

        return;
      }
    }
   
    File dialogFile = new File(dialogSubDir.toString() + File.separator + dialogName);
    BufferedWriter br = new BufferedWriter(new FileWriter(dialogFile));
    br.write(response + "\n");
    br.flush();
    br.close();
  }
View Full Code Here

Examples of java.io.FileWriter

        this.file = file;
        open();
    }
   
    protected synchronized void open() throws IOException {
        log = new PrintWriter(new FileWriter(file, true), true);
        closed = false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.