/** * {@inheritDoc} */ public InputStream get(String blobId) throws Exception { return getResource(blobId).getInputStream(); }
/** * {@inheritDoc} */ public InputStream get(String blobId) throws Exception { return getResource(blobId).getInputStream(); }
/** * Read locks from locks file and populate path map */ private void load() throws FileSystemException { BufferedReader reader = null; try { reader = new BufferedReader( new InputStreamReader(locksFile.getInputStream())); while (true) { String s = reader.readLine(); if (s == null || s.equals("")) { break; } reapplyLock(s); } } catch (IOException e) { throw new FileSystemException("error while reading locks file", e); } finally { IOUtils.closeQuietly(reader); } }
/** * Loads the lookup table from the filesystem resource. */ protected void load() { try { long modTime = file.lastModified(); if (modTime != lastModified) { lastModified = modTime; InputStream in = file.getInputStream(); try { Properties properties = new Properties(); properties.load(in); for (Object name : Collections.list(properties.propertyNames())) { String string = name.toString(); Integer index = Integer.valueOf(properties.getProperty(string)); stringToIndex.put(string, index); indexToString.put(index, string); } } finally { in.close(); } } } catch (Exception e) { throw new IllegalStateException("Unable to load lookup table", e); } }
/** * Read locks from locks file and populate path map */ private void load() throws FileSystemException { BufferedReader reader = null; try { reader = new BufferedReader( new InputStreamReader(locksFile.getInputStream())); while (true) { String s = reader.readLine(); if (s == null || s.equals("")) { break; } reapplyLock(s); } } catch (IOException e) { throw new FileSystemException("error while reading locks file", e); } finally { IOUtils.closeQuietly(reader); } }
/** * Loads the lookup table from the filesystem resource. */ protected void load() { try { long modTime = file.lastModified(); if (modTime != lastModified) { lastModified = modTime; InputStream in = file.getInputStream(); try { Properties properties = new Properties(); properties.load(in); for (Object name : Collections.list(properties.propertyNames())) { String string = name.toString(); Integer index = Integer.valueOf(properties.getProperty(string)); stringToIndex.put(string, index); indexToString.put(index, string); } } finally { in.close(); } } } catch (Exception e) { throw new IllegalStateException("Unable to load lookup table", e); } }
public InputStream getStream() throws RepositoryException { try { return fsResource.getInputStream(); } catch (FileSystemException fse) { throw new RepositoryException(fsResource.getPath() + ": the specified resource does not exist", fse); } }
public InputStream getStream() throws RepositoryException { try { return fsResource.getInputStream(); } catch (FileSystemException fse) { throw new RepositoryException(fsResource.getPath() + ": the specified resource does not exist", fse); } }
/** * Reads the synonym properties file and returns the contents as a synonym * Map. * * @param config the synonym properties file. * @return a Map containing the synonyms. * @throws IOException if an error occurs while reading from the file system * resource. */ private static Map<String, String[]> getSynonyms(FileSystemResource config) throws IOException { try { Map<String, String[]> synonyms = new HashMap<String, String[]>(); Properties props = new Properties(); props.load(config.getInputStream()); for (Map.Entry<Object, Object> entry : props.entrySet()) { String key = (String) entry.getKey(); String value = (String) entry.getValue(); addSynonym(key, value, synonyms); addSynonym(value, key, synonyms); } return synonyms; } catch (FileSystemException e) { throw Util.createIOException(e); } }
/** * Reads the synonym properties file and returns the contents as a synonym * Map. * * @param config the synonym properties file. * @return a Map containing the synonyms. * @throws IOException if an error occurs while reading from the file system * resource. */ private static Map<String, String[]> getSynonyms(FileSystemResource config) throws IOException { try { Map<String, String[]> synonyms = new HashMap<String, String[]>(); Properties props = new Properties(); props.load(config.getInputStream()); for (Map.Entry<Object, Object> entry : props.entrySet()) { String key = (String) entry.getKey(); String value = (String) entry.getValue(); addSynonym(key, value, synonyms); addSynonym(value, key, synonyms); } return synonyms; } catch (FileSystemException e) { throw Util.createIOException(e); } }
private Map<Name, PrivilegeDefinition> load() throws FileSystemException, RepositoryException, ParseException, IOException { Map<Name, PrivilegeDefinition> stubs = new LinkedHashMap<Name, PrivilegeDefinition>(); if (customPrivilegesResource.exists()) { InputStream in = customPrivilegesResource.getInputStream(); try { PrivilegeDefinitionReader pr = new PrivilegeDefinitionReader(in, "text/xml"); for (PrivilegeDefinition def : pr.getPrivilegeDefinitions()) { Name privName = def.getName(); if (stubs.containsKey(privName)) { throw new RepositoryException("Duplicate entry for custom privilege with name " + privName.toString()); } stubs.put(privName, def); } } finally { in.close(); } } return stubs; }
private Map<Name, PrivilegeDefinition> load() throws FileSystemException, RepositoryException, ParseException, IOException { Map<Name, PrivilegeDefinition> stubs = new LinkedHashMap<Name, PrivilegeDefinition>(); if (customPrivilegesResource.exists()) { InputStream in = customPrivilegesResource.getInputStream(); try { PrivilegeDefinitionReader pr = new PrivilegeDefinitionReader(in, "text/xml"); for (PrivilegeDefinition def : pr.getPrivilegeDefinitions()) { Name privName = def.getName(); if (stubs.containsKey(privName)) { throw new RepositoryException("Duplicate entry for custom privilege with name " + privName.toString()); } stubs.put(privName, def); } } finally { in.close(); } } return stubs; }
return; BufferedInputStream bis = new BufferedInputStream(fsRes.getInputStream()); DataInputStream in = new DataInputStream(bis); bis = new BufferedInputStream(fsRes.getInputStream()); in = new DataInputStream(bis);
InputStream in = customPrivilegesResource.getInputStream(); try { PrivilegeDefinitionReader pr = new PrivilegeDefinitionReader(in, "text/xml");
InputStream in = customPrivilegesResource.getInputStream(); try { PrivilegeDefinitionReader pr = new PrivilegeDefinitionReader(in, "text/xml");
try { if (customNodeTypesResource.exists()) { in = customNodeTypesResource.getInputStream();
InputStream in = uuidFile.getInputStream(); try { return NodeId.valueOf(IOUtils.toString(in, "US-ASCII"));
InputStream in = uuidFile.getInputStream(); try { return NodeId.valueOf(IOUtils.toString(in, "US-ASCII"));
BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(retentionFile.getInputStream())); String line; while ((line = reader.readLine()) != null) {
BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(retentionFile.getInputStream())); String line; while ((line = reader.readLine()) != null) {