Examples of

    File file = new File(fileName);
    switch (returnType) {
    case StreamUtils.TYPE_STRING:
      return readerToAnyString(new BufferedReader(new FileReader(file)));

    case StreamUtils.TYPE_LINES:
      return readerToAnyStringArray(new BufferedReader(new FileReader(file)));

    case StreamUtils.TYPE_BINARY:
      return streamToAnyByteArray(new FileInputStream(file));

    case StreamUtils.TYPE_DATA:
View Full Code Here

                return false;

        try {
            settingsReader = new LineNumberReader(new FileReader(settingsFile));
        } catch (final Exception e) {
            logger.warning(settingsFile.getName() + " does not exist, will create it");
            return false;
        try {
View Full Code Here

  public static final Any readText(Context context, Any file)
    try {
      File source = toFile(file);
      BufferedReader reader = new BufferedReader(new FileReader(source));
      StringBuffer buf = new StringBuffer();
      String line;
      while (true) {
        line = reader.readLine();
        if (line == null) {
View Full Code Here

        File testCasesFile = new File(resourceDir, "TestCase.list");
        if(!testCasesFile.exists()) {
            return Collections.emptyList();
        List<Class<? extends TestCase>> testCases = new ArrayList<Class<? extends TestCase>>(512);
        BufferedReader reader = new BufferedReader(new FileReader(testCasesFile));
        String line = null;
        while((line = reader.readLine()) != null) {
            String clazzName = line.trim();
            boolean ignore = false;
            for(String list : IGNORE_LIST) {
View Full Code Here

                select.marshalVersioned(customer, customer.version);
                // run comparison of output with original document
                InputStreamReader brdr = new InputStreamReader
                    (new ByteArrayInputStream(bos.toByteArray()), "UTF-8");
                FileReader frdr = new FileReader(args[0]);
                FileOutputStream fos = new FileOutputStream("temp.xml");
                DocumentComparator comp = new DocumentComparator(System.err);
                if (!, brdr)) {
View Full Code Here

          List<String> fn = (List<String>) event.getNewValue();
          propertiesFile = new File(fn.get(0));

          try {
            if (propertiesFile.canRead() == true) {
              FileReader in = new FileReader(propertiesFile);
              logger.trace("Reading properties from "+ propertiesFile);

            } else {
View Full Code Here

   * Reads properties from a named file.
   * @param filename filename to open up and read properties from.
  private void readAllProperties(String filename) throws IOException {
    FileReader reader = new FileReader(filename);

View Full Code Here

      if (null==args) {
        System.out.println("Usage: DBCurrencies cnf_file_path base_currency_3_letter_code");
      } else if (args.length<2) {
        System.out.println("Usage: DBCurrencies cnf_file_path base_currency_3_letter_code");
      } else {
    FileReader oReader = new FileReader(args[0]);
    Properties oDatabaseConnectionProps = new Properties();

    DriverManager.registerDriver((Driver) Class.forName(oDatabaseConnectionProps.getProperty("driver")).newInstance());
    Connection oConn = DriverManager.getConnection(oDatabaseConnectionProps.getProperty("dburl"),oDatabaseConnectionProps.getProperty("dbuser"),oDatabaseConnectionProps.getProperty("dbpassword"));
      try {
View Full Code Here

  public void testResolveStrings2() throws FileNotFoundException,
      IOException, TransformerException {

    ParserResult result = BibtexParser.parse(new FileReader(

    assertEquals("Arvind", result.getDatabase().resolveForStrings(

View Full Code Here

    String line;
    StringBuffer testData = new StringBuffer();

      BufferedReader instream = new BufferedReader(new FileReader(
          new File(filename)));
      while ((line = instream.readLine()) != null)
View Full Code Here


Related Classes of

Copyright © 2018 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