Java Scanner Read read(Class clazz, String f)

Here you can find the source of read(Class clazz, String f)

Description

read

License

Apache License

Declaration

public static String read(Class clazz, String f) 

Method Source Code


//package com.java2s;
/*// w ww.j  av  a 2  s  .  co m
 * Copyright 2014 Telefonica Investigaci?n y Desarrollo, S.A.U
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.util.Scanner;

public class Main {
    public static String read(Class clazz, String f) {
        return new Scanner(clazz.getResourceAsStream(f)).useDelimiter("\\Z").next();
    }
}

Related

  1. loadSentencesMap(String path)
  2. loadSolution(File file)
  3. loadTestProgram(final Class resourceClass, final String fileName)
  4. loadTimeseries(File file, String delimeter, int _amountOfLines)
  5. read()
  6. readArr(Scanner in, int n)
  7. readCQLFile(String cqlFileName)
  8. readFile(Class ownerClass, String fileName)
  9. readFile(File f)