List of usage examples for java.lang System err
PrintStream err
To view the source code for java.lang System err.
Click Source Link
From source file:Main.java
public static void main(String[] args) { DosFileAttributes attr = null; Path path = Paths.get("C:/tutorial/Java/JavaFX", "Topic.txt"); try {//from w w w . j a v a 2 s .co m attr = Files.readAttributes(path, DosFileAttributes.class); } catch (IOException e) { System.err.println(e); } System.out.println("Is read only ? " + attr.isReadOnly()); }
From source file:Main.java
public static void main(String[] args) { DosFileAttributes attr = null; Path path = Paths.get("C:/tutorial/Java/JavaFX", "Topic.txt"); try {/*from w w w. j ava 2s. co m*/ attr = Files.readAttributes(path, DosFileAttributes.class); } catch (IOException e) { System.err.println(e); } System.out.println("Is archive ? " + attr.isArchive()); }
From source file:Main.java
public static void main(String[] args) { DosFileAttributes attr = null; Path path = Paths.get("C:/tutorial/Java/JavaFX", "Topic.txt"); try {//from w w w .j a va 2 s. c o m attr = Files.readAttributes(path, DosFileAttributes.class); } catch (IOException e) { System.err.println(e); } System.out.println("Is system ? " + attr.isSystem()); }
From source file:Main.java
public static void main(String[] args) { DosFileAttributes attr = null; Path path = Paths.get("C:/tutorial/Java/JavaFX", "Topic.txt"); try {/*from www. ja v a2s . com*/ attr = Files.readAttributes(path, DosFileAttributes.class); } catch (IOException e) { System.err.println(e); } System.out.println("Is Hidden ? " + attr.isHidden()); }
From source file:TestRedundantObjectPool.java
public static void main(String args[]) throws Exception { SoftReferenceObjectPool pool =//from www. j a v a2 s .c o m new SoftReferenceObjectPool(new EmployeeFactory(), 5); try{ System.err.println("Number of employees in pool: " + pool.getNumIdle()); Employee employee = (Employee)pool.borrowObject(); System.err.println("Borrowed Employee: " + employee); employee.doWork(); pool.returnObject(employee); // employee = null; HashMap map = new HashMap(); System.err.println("Running memory intensive operation"); for(int i = 0; i < 1000000; i++) { map.put(new Integer(i), new String("Fred Flintstone" + i)); } }catch(OutOfMemoryError e) { System.err.println("Borrowed employee after OutOfMemory: " + pool.borrowObject()); System.err.println("Error: " + e); } }
From source file:MainClass.java
public static void main(String args[]) { URL u;// w ww .ja v a 2 s . co m URLConnection uc; try { u = new URL("http://www.java2s.com/"); try { uc = u.openConnection(); System.out.println(uc.getURL()); } catch (IOException e) { System.err.println(e); } } catch (MalformedURLException e) { System.err.println(e); } }
From source file:MainClass.java
public static void main(String[] a) { File aFile = new File("C:/myFile.text"); FileInputStream inputFile1 = null; FileDescriptor fd = null;/*from w w w . j a va2 s .com*/ try { inputFile1 = new FileInputStream(aFile); fd = inputFile1.getFD(); } catch (IOException e) { e.printStackTrace(System.err); System.exit(1); } FileInputStream inputFile2 = new FileInputStream(fd); }
From source file:Unbuffered.java
public static void main(String args[]) { Reader reader;/*from w w w . j a v a2s. c o m*/ int ch; System.out.println("Start! " + new Date()); try { reader = new FileReader(args[0]); while ((ch = reader.read()) != -1) { // read entire file } } catch (IOException io) { System.err.println(io); System.exit(-1); } System.out.println("Stop! " + new Date()); }
From source file:lycos.java
public static void main(String[] args) { try {/*from w w w . ja va 2 s.c om*/ String thisLine; URL u = new URL("http://www.google.com"); DataInputStream theHTML = new DataInputStream(u.openStream()); while ((thisLine = theHTML.readLine()) != null) { System.out.println(thisLine); } // while loop ends here } catch (MalformedURLException e) { System.err.println(e); } catch (IOException e) { System.err.println(e); } }
From source file:Main.java
public static void main(String[] args) { Path path = Paths.get("/tutorial/Java/JavaFX", "Topic.txt"); // convert path to "real" path try {//w ww. j a va2 s . c o m Path real_path = path.toRealPath(LinkOption.NOFOLLOW_LINKS); System.out.println("Path to real path: " + real_path); } catch (IOException e) { System.err.println(e); } }