/** * {@inheritDoc} */ @Override public InputStream getAsStream() throws IOException { return PrivilegedFileHelper.fileInputStream(file); }
/** * FileObjectReaderImpl constructor. * * @param file * Source file to reading * @throws FileNotFoundException * if file does not exist */ public FileObjectReaderImpl(File file) throws FileNotFoundException { this.channel = PrivilegedFileHelper.fileInputStream(file).getChannel(); }
/** * {@inheritDoc} */ public void writeTo(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { InputStream in = PrivilegedFileHelper.fileInputStream(t); try { IOHelper.write(in, entityStream); } finally { in.close(); } }
/** * {@inheritDoc} */ @Override public InputStream getAsStream() throws IOException { if (url != null) { if (tempFile != null) { return PrivilegedFileHelper.fileInputStream(tempFile); } else if (spoolContent) { spoolContent(); return PrivilegedFileHelper.fileInputStream(tempFile); } return url.openStream(); } return super.getAsStream(); }
/** * {@inheritDoc} */ @Override public InputStream getAsStream() throws IOException { if (isByteArrayAfterSpool()) { return new ByteArrayInputStream(data); // from bytes } else { if (spoolFile != null) { return PrivilegedFileHelper.fileInputStream(spoolFile); // from spool file } else { throw new IllegalArgumentException("Stream already consumed"); } } }
/** * @return - input stream. * @throws IOException * - unknown output stream. */ public InputStream getInputStream() throws IOException { flush(); if (out instanceof ByteArrayOutputStream) { return new ByteArrayInputStream(((ByteArrayOutputStream)out).toByteArray()); } else if (out instanceof BufferedOutputStream) { out.close(); return new BufferedInputStream(PrivilegedFileHelper.fileInputStream(fileBuffer)); } else { throw new IOException("unexpected change of buffer"); } }
BufferedInputStream is = new BufferedInputStream(PrivilegedFileHelper.fileInputStream(fileBuffer));
in = PrivilegedFileHelper.fileInputStream(file); channel = in.getChannel();
InputStream in = PrivilegedFileHelper.fileInputStream(logFile); try
in = PrivilegedFileHelper.fileInputStream(file); channel = in.getChannel();
bufInput = PrivilegedFileHelper.fileInputStream(f);
public void addFile(String entryName, File file) { try { InputStream is = PrivilegedFileHelper.fileInputStream(file); datas_.add(new InputStreamDataInstance(entryName, is)); } catch (FileNotFoundException e) { LOG.error(e.getLocalizedMessage(), e); } }
InputStream in = PrivilegedFileHelper.fileInputStream(storage); try
new BufferedInputStream(PrivilegedFileHelper.fileInputStream(new File(root, synonymProviderConfigPath .substring(lastSeparator + 1)))); fsr = new BufferedInputStream(PrivilegedFileHelper.fileInputStream(new File(synonymProviderConfigPath)));
factory.createXMLEventReader(PrivilegedFileHelper.fileInputStream(bindingsStorePath), "UTF-8");
return PrivilegedFileHelper.fileInputStream(sf);
in = new ObjectInputStream(PrivilegedFileHelper.fileInputStream(contentFile));
new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new File(storageDir, "JDBCWorkspaceDataContainer.info")));;
try ois = new ObjectInputStream(PrivilegedFileHelper.fileInputStream(incrementalBackupFile));
in = PrivilegedFileHelper.fileInputStream(((StreamPersistedValueData)vd).getTempFile());