Examples of QTemporaryFile


Examples of com.trolltech.qt.core.QTemporaryFile

    for (int i=0; i<20 && d.getSize() == 0; i++)
      d = r.getData();
    if (d.getSize()== 0)
      return;

    QTemporaryFile f = writeResource(d);
    if (!keepRunning) {
      return;
    }
   
    InputStream input;
    try {
      input = new FileInputStream(new File(f.fileName()));
      ContentHandler textHandler = new BodyContentHandler(-1);
      Metadata metadata = new Metadata();
      RTFParser parser = new RTFParser()
      ParseContext context = new ParseContext();
      parser.parse(input, textHandler, metadata, context);
      String[] result = textHandler.toString().split(regex);
      for (int i=0; i<result.length && keepRunning; i++) {
        addToIndex(r.getNoteGuid(), result[i], "RESOURCE");
      }
      input.close();
   
      f.close();
    } catch (java.lang.ClassCastException e) {
      logger.log(logger.LOW, "Cast exception: " +e.getMessage());
    } catch (FileNotFoundException e) {
      logger.log(logger.LOW, "FileNotFound  exception: " +e.getMessage());
    } catch (IOException e) {
View Full Code Here

Examples of com.trolltech.qt.core.QTemporaryFile

    Data d = r.getData();
    for (int i=0; i<20 && d.getSize() == 0; i++)
      d = r.getData();
    if (d.getSize()== 0)
      return;
    QTemporaryFile f = writeResource(d);
    if (!keepRunning) {
      return;
    }
   
    InputStream input;
    try {
      input = new FileInputStream(new File(f.fileName()));
      ContentHandler textHandler = new BodyContentHandler(-1);
      Metadata metadata = new Metadata();
      OpenDocumentParser parser = new OpenDocumentParser()
      ParseContext context = new ParseContext();
      parser.parse(input, textHandler, metadata, context);
      String[] result = textHandler.toString().split(regex);
      for (int i=0; i<result.length && keepRunning; i++) {
        if (interrupt) {
          processInterrupt();
        }
        addToIndex(r.getNoteGuid(), result[i], "RESOURCE");
      }
      input.close();
   
      f.close();
    } catch (java.lang.ClassCastException e) {
      logger.log(logger.LOW, "Cast exception: " +e.getMessage());
    } catch (FileNotFoundException e) {
      logger.log(logger.LOW, "FileNotFound  exception: " +e.getMessage());
    } catch (IOException e) {
View Full Code Here

Examples of com.trolltech.qt.core.QTemporaryFile

    Data d = r.getData();
    for (int i=0; i<20 && d.getSize() == 0; i++)
      d = r.getData();
    if (d.getSize()== 0)
      return;
    QTemporaryFile f = writeResource(d);
    if (!keepRunning) {
      return;
    }
   
    InputStream input;
    try {
      input = new FileInputStream(new File(f.fileName()));
      ContentHandler textHandler = new BodyContentHandler(-1);
      Metadata metadata = new Metadata();
      OfficeParser parser = new OfficeParser()
      ParseContext context = new ParseContext();
      parser.parse(input, textHandler, metadata, context);
      String[] result = textHandler.toString().split(regex);
      for (int i=0; i<result.length && keepRunning; i++) {
        if (interrupt) {
          processInterrupt();
        }
        addToIndex(r.getNoteGuid(), result[i], "RESOURCE");
      }
      input.close();
   
      f.close();
    } catch (java.lang.ClassCastException e) {
      logger.log(logger.LOW, "Cast exception: " +e.getMessage());
    } catch (FileNotFoundException e) {
      logger.log(logger.LOW, "FileNotFound  exception: " +e.getMessage());
    } catch (IOException e) {
View Full Code Here

Examples of com.trolltech.qt.core.QTemporaryFile

    Data d = r.getData();
    for (int i=0; i<20 && d.getSize() == 0; i++)
      d = r.getData();
    if (d.getSize()== 0)
      return;
    QTemporaryFile f = writeResource(d);
    if (!keepRunning) {
      return;
    }
   
    InputStream input;
    try {     
      input = new FileInputStream(new File(f.fileName()));
      ContentHandler textHandler = new BodyContentHandler(-1);
      Metadata metadata = new Metadata();
      PDFParser parser = new PDFParser()
      ParseContext context = new ParseContext();
      parser.parse(input, textHandler, metadata, context);
      String[] result = textHandler.toString().split(regex);
      for (int i=0; i<result.length && keepRunning; i++) {
        if (interrupt) {
          processInterrupt();
        }
        addToIndex(r.getNoteGuid(), result[i], "RESOURCE");
      }
      input.close();
   
      f.close();
    } catch (java.lang.ClassCastException e) {
      logger.log(logger.LOW, "Cast exception: " +e.getMessage());
    } catch (FileNotFoundException e) {
      logger.log(logger.LOW, "FileNotFound  exception: " +e.getMessage());
    } catch (IOException e) {
View Full Code Here

Examples of com.trolltech.qt.core.QTemporaryFile

    Data d = r.getData();
    for (int i=0; i<20 && d.getSize() == 0; i++)
      d = r.getData();
    if (d.getSize()== 0)
      return;
    QTemporaryFile f = writeResource(d);
    if (!keepRunning) {
      return;
    }
   
    InputStream input;
    try {
      input = new FileInputStream(new File(f.fileName()));
      ContentHandler textHandler = new BodyContentHandler(-1);
      Metadata metadata = new Metadata();
      OOXMLParser parser = new OOXMLParser()
      ParseContext context = new ParseContext();
      parser.parse(input, textHandler, metadata, context);
      String[] result = textHandler.toString().split(regex);
      for (int i=0; i<result.length && keepRunning; i++) {
        if (interrupt) {
          processInterrupt();
        }
        addToIndex(r.getNoteGuid(), result[i], "RESOURCE");
      }
      input.close();
   
      f.close();
    } catch (java.lang.ClassCastException e) {
      logger.log(logger.LOW, "Cast exception: " +e.getMessage());
    } catch (FileNotFoundException e) {
      logger.log(logger.LOW, "FileNotFound  exception: " +e.getMessage());
    } catch (IOException e) {
View Full Code Here

Examples of com.trolltech.qt.core.QTemporaryFile

  }
 

 
  private QTemporaryFile writeResource(Data d) {
    QTemporaryFile newFile = new QTemporaryFile();
    newFile.open(OpenModeFlag.WriteOnly);
    newFile.write(d.getBody());
    newFile.close();
    return newFile;
  }
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.