Package java.io

Examples of java.io.RandomAccessFile.readLine()


          if (logFilepointer > 0) {
            checkPrevFile.seek(logFilepointer);
            spooler_log.debug3("starting to check previous log file [" + prevLogFile.getCanonicalPath() + "] from position: " + logFilepointer);
          }
          //alte Fehlermeldung merken
          while((logLine = checkPrevFile.readLine()) != null) {
            if (logLine.matches( "^\\d{4}-\\d{1,2}-\\d{1,2} +\\d{1,2}:\\d{1,2}:\\d{1,2}(\\.\\d{1,3})? +\\[WARN\\] +.*" )) {
              message = new SchedulerMessage(logFile, "WARN",logLine,spooler.id(), this.getConnection(),sosLogger);
              spooler_log.debug9("..old WARN =" + logLine);
              if (!messages.contains(message))
                 messages.add(message);
View Full Code Here


      RandomAccessFile inputFile = new RandomAccessFile(inputFileName, "r");
      // 2. Loop over all files
      String path = null;
      fileRenamingList = new Hashtable();
     
      while ( (path = inputFile.readLine()) != null) {
        testOut("process path=" + path);
        // get pagename from wiki.properties file
        String wikiPropertiesFileName = path.substring(0,path.length() - ".wp".length()) + ".properties";
        Properties wikiProperties = new Properties();
        wikiProperties.load(new FileInputStream(wikiPropertiesFileName));
View Full Code Here

      String inputFileName = args[0];
      RandomAccessFile inputFile = new RandomAccessFile(inputFileName, "r");
      // 2. Loop over all files
      String wikiPropertiesFileName = null;
     
      while ( (wikiPropertiesFileName = inputFile.readLine()) != null) {
        log("process path=" + wikiPropertiesFileName,"");
        // get pagename from wiki.properties file
        String oldWikiFileName = wikiPropertiesFileName.substring(0,wikiPropertiesFileName.length() - ".properties".length()) + ".wp";
        Properties wikiProperties = new Properties();
        wikiProperties.load(new FileInputStream(wikiPropertiesFileName));
View Full Code Here

        tail.append("\n-------------------- "+tag+"---------------------\n");
        String[] lines = null;
        if (num >0) {
          lines = new String[num];
        }
        while ((line = rafile.readLine()) != null) {
          no_lines++;
          if (num >0) {
            if (no_lines <= num) {
              lines[no_lines-1] = line;
            }
View Full Code Here

    RandomAccessFile raf;
    try {
      raf = new RandomAccessFile(dbFile, "r");
      String line;
      do {
        line = raf.readLine();
      } while (!line.startsWith(START));
      // Remove ##start##
      line = line.substring(START.length());
      // Count of entries (each being 7 Bytes)
      int size = line.length() / 7;
View Full Code Here

        tail.append("\n-------------------- "+tag+"---------------------\n");
        String[] lines = null;
        if (num >0) {
          lines = new String[num];
        }
        while ((line = rafile.readLine()) != null) {
          no_lines++;
          if (num >0) {
            if (no_lines <= num) {
              lines[no_lines-1] = line;
            }
View Full Code Here

          }
          raf.seek(len-TESTRESULTS_END.length()-10);//TODO: may not work on all OSes?
          String line;
          long pos = raf.getFilePointer();
          int end=0;
          while((line = raf.readLine()) != null)// reads to end of line OR file
          {
              end = line.indexOf(TESTRESULTS_END);
              if (end >= 0) // found the string
              {
                break;
View Full Code Here

   static void parseHeader(File javaFile)
         throws IOException
   {
      totalCount++;
      RandomAccessFile raf = new RandomAccessFile(javaFile, "rw");
      String line = raf.readLine();
      StringBuffer tmp = new StringBuffer();
      long endOfHeader = 0;
      boolean packageOrImport = false;
      while (line != null)
      {
View Full Code Here

         long nextEOH = raf.getFilePointer();
         line = line.trim();
         // Ignore any single line comments
         if (line.startsWith("//"))
         {
            line = raf.readLine();
            continue;
         }

         // If this is a package/import/class/interface statement break
         if (line.startsWith("package") || line.startsWith("import")
View Full Code Here

         else if (line.startsWith("*"))
            tmp.append(line.substring(1));
         else
            tmp.append(line);
         tmp.append(' ');
         line = raf.readLine();
      }
      raf.close();

      if (tmp.length() == 0 || !packageOrImport)
      {
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.