Examples of TextFile


Examples of org.apache.ws.jaxme.js.TextFile

      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packages.contains(packageName)) {
        continue;
      }

      TextFile textFile = pController.getJavaSourceFactory().newTextFile(packageName, "jaxb.properties");
      textFile.addLine(JAXBContext.JAXB_CONTEXT_FACTORY + "=" + JAXBContextImpl.class.getName());
      packages.add(packageName);

      String configFile = generateConfigFile(pController, packageName, contextList);
      TextFile confFile = pController.getJavaSourceFactory().newTextFile(packageName, "Configuration.xml");
      confFile.setContents(configFile);

      getObjectFactory(pController, packageName, contextList);
    }
  }
View Full Code Here

Examples of org.evolizer.core.util.collections.TextFile

   
    theJavaProject.setRawClasspath(newEntries, sub.newChild(1));
  }

  private String readFileContent(File file) {     
    return new TextFile(file).asString();
  }
View Full Code Here

Examples of org.nimbustools.auto_config.TextFile

            System.out.println("    ... already set to " + setString);
            System.out.println("    ... in the file '" + conf.getCanonicalPath() + "'");
            return; // *** EARLY RETURN ***
        }

        final TextFile textFile = new TextFile(conf.getAbsolutePath());
        if (textFile.isEmpty()) {
            throw new Exception("File is empty? '" +
                    conf.getAbsolutePath() + "'");
        }

        boolean replaced = false;
        final int size = textFile.size();
        for (int i = 0; i < size; i++) {
            final String line = (String) textFile.get(i);
            if (line != null && line.trim().length() > 0) {
                if (line.trim().startsWith(keyword)) {
                    final String newline;
                    if (newvalue == null) {
                        newline = "#" + keyword + "=";
                    } else {
                        newline = keyword + "=" + newvalue.trim();
                    }
                    textFile.set(i, newline);
                    replaced = true;
                    break;
                }
            }
        }

        if (!replaced) {
            // race condition with getProperty() on file contents?
            throw new Exception("Could not alter the configuration file, no '" +
                    keyword + "' setting present in the file '" +
                    conf.getAbsolutePath() + "' (?)");
        }

        textFile.writeFile(conf);

        System.out.println("[*] The '" + keyword + "' configuration was:");
        if (newvalue == null) {
            System.out.println("    ... commented out");
        } else if (newvalue.trim().length() == 0) {
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.