Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void cat(String[] cmd) {
- File f = new File(wd, cmd[1]);
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(f));
- String line;
- while ((line = br.readLine()) != null) {
- System.out.println(line);
- }
- } catch (FileNotFoundException fnf) {
- System.out.println("file was not found");
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- if (br != null)
- br.close();
- } catch (IOException e) {
- System.out.println("couldn't close br");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement