List of usage examples for java.util.zip ZipInputStream getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.seer.datacruncher.streams.ZipStreamTest.java
private boolean isStreamClose(ZipInputStream inStream) { try {/*from w w w .ja v a2s . co m*/ Class<?> c = inStream.getClass(); Field in; in = c.getDeclaredField("closed"); in.setAccessible(true); Boolean inReader = (Boolean) in.get(inStream); return inReader; } catch (Exception e) { logger.error(e); } return false; }
From source file:com.seer.datacruncher.spring.ValidateFilePopupController.java
/** * This method will use to know about the IO Stream is closed or Open. * There some issue in ZipInputStream.getNextEntry() some time its throws Exception of 'stream close' instead of return null. * So this is a method will get private field [closed] of InputStream class so program could know that stream is open or closed. * @return boolean//from w w w . ja v a2s .co m * It will return true if stream is closed else return false */ private boolean isStreamClose(ZipInputStream inStream) { try { Class c = inStream.getClass(); Field in; in = c.getDeclaredField("closed"); in.setAccessible(true); Boolean inReader = (Boolean) in.get(inStream); return inReader; } catch (Exception e) { logger.error(e); } return false; }
From source file:com.seer.datacruncher.services.ftp.FTPPollJobProcessor.java
private boolean isStreamClose(ZipInputStream inStream) { try {//from w w w.j ava 2 s . c o m @SuppressWarnings("rawtypes") Class c = inStream.getClass(); Field in; in = c.getDeclaredField("closed"); in.setAccessible(true); Boolean inReader = (Boolean) in.get(inStream); return inReader; } catch (Exception e) { log.error(e); } return false; }