Skip to content

Instantly share code, notes, and snippets.

@enif-lee
Last active December 30, 2016 09:50
Show Gist options
  • Save enif-lee/635a8b22ff9105306cc3d8684f3fe30c to your computer and use it in GitHub Desktop.
Save enif-lee/635a8b22ff9105306cc3d8684f3fe30c to your computer and use it in GitHub Desktop.
import java.util.Scanner;
/**
* Created by Jinseoung on 2016-12-30.
*/
public class ClasspathLoaderSample {
// if file is existed in src/main/resource/path/to/prob.testcase
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("path/to/prob.testcase"));
public static void main(String[] args) {
while(sc.hasNext()){
System.out.println(sc.nextLine());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment