private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private InputStream getInputStream(String managedFiles, int openMask) throws IOException { if (useReliableFiles) { int id = getId(managedFiles); if (id == -1) return null; return new ReliableFileInputStream(new File(getBase(), managedFiles), id, openMask); } File lookup = lookup(managedFiles, false); if (lookup == null) return null; return new FileInputStream(lookup); }
private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException { File stateFile = new File(stateDirectory, StateReader.STATE_FILE); File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE); if (!stateFile.exists() || !lazyFile.exists()) { StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$ try { // if the directory is pointing at the configuration directory then the base files will not exist storageManager.open(true); // try using the storage manager to find the managed state files (bug 143255) File managedState = storageManager.lookup(StateReader.STATE_FILE, false); File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false); if (managedState != null && managedLazy != null) { stateFile = managedState; lazyFile = managedLazy; } } finally { storageManager.close(); } } StateReader reader = new StateReader(stateFile, lazyFile, false); if (!reader.loadState(toRestore, expectedTimestamp)) return null; return toRestore; }
private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException { File stateFile = new File(stateDirectory, StateReader.STATE_FILE); File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE); if (!stateFile.exists() || !lazyFile.exists()) { StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$ try { // if the directory is pointing at the configuration directory then the base files will not exist storageManager.open(true); // try using the storage manager to find the managed state files (bug 143255) File managedState = storageManager.lookup(StateReader.STATE_FILE, false); File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false); if (managedState != null && managedLazy != null) { stateFile = managedState; lazyFile = managedLazy; } } finally { storageManager.close(); } } StateReader reader = new StateReader(stateFile, lazyFile, false); if (!reader.loadState(toRestore, expectedTimestamp)) return null; return toRestore; }
private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException { File stateFile = new File(stateDirectory, StateReader.STATE_FILE); File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE); if (!stateFile.exists() || !lazyFile.exists()) { StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$ try { // if the directory is pointing at the configuration directory then the base files will not exist storageManager.open(true); // try using the storage manager to find the managed state files (bug 143255) File managedState = storageManager.lookup(StateReader.STATE_FILE, false); File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false); if (managedState != null && managedLazy != null) { stateFile = managedState; lazyFile = managedLazy; } } finally { storageManager.close(); } } StateReader reader = new StateReader(stateFile, lazyFile, false); if (!reader.loadState(toRestore, expectedTimestamp)) return null; return toRestore; }
private State internalReadState(StateImpl toRestore, File stateDirectory, long expectedTimestamp) throws IOException { File stateFile = new File(stateDirectory, StateReader.STATE_FILE); File lazyFile = new File(stateDirectory, StateReader.LAZY_FILE); if (!stateFile.exists() || !lazyFile.exists()) { StorageManager storageManager = new StorageManager(stateDirectory, "none", true); //$NON-NLS-1$ try { // if the directory is pointing at the configuration directory then the base files will not exist storageManager.open(true); // try using the storage manager to find the managed state files (bug 143255) File managedState = storageManager.lookup(StateReader.STATE_FILE, false); File managedLazy = storageManager.lookup(StateReader.LAZY_FILE, false); if (managedState != null && managedLazy != null) { stateFile = managedState; lazyFile = managedLazy; } } finally { storageManager.close(); } } StateReader reader = new StateReader(stateFile, lazyFile, false); if (!reader.loadState(toRestore, expectedTimestamp)) return null; return toRestore; }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
storageManager.open(!readOnly); File dataFile = storageManager.lookup(fileName, false); if (dataFile == null || !dataFile.isFile()) { Location parent = location.getParentLocation(); StorageManager tmp = new StorageManager(theStorageDir, "none", true); //$NON-NLS-1$ tmp.open(false); dataFile = tmp.lookup(fileName, false); tmp.close();
protected boolean checkCache() { for (int index = 0; index < strategy.getLocationsLength(); index++) { File possibleCacheLocation = strategy.getStorage(index); if (possibleCacheLocation == null) break; // bail out on the first null setFileManager(possibleCacheLocation, strategy.isCacheReadOnly(index)); if (cacheStorageManager != null) { // check this new location: File cacheFile = null; try { cacheFile = cacheStorageManager.lookup(TableReader.getTestFileName(), false); } catch (IOException e) { //Ignore the exception. The registry will be rebuilt from the xml files. } if (cacheFile != null && cacheFile.isFile()) return true; // found the appropriate location } } return false; }
protected boolean checkCache() { for (int index = 0; index < strategy.getLocationsLength(); index++) { File possibleCacheLocation = strategy.getStorage(index); if (possibleCacheLocation == null) break; // bail out on the first null setFileManager(possibleCacheLocation, strategy.isCacheReadOnly(index)); if (cacheStorageManager != null) { // check this new location: File cacheFile = null; try { cacheFile = cacheStorageManager.lookup(TableReader.getTestFileName(), false); } catch (IOException e) { //Ignore the exception. The registry will be rebuilt from the xml files. } if (cacheFile != null && cacheFile.isFile()) return true; // found the appropriate location } } return false; }
protected boolean checkCache() { for (int index = 0; index < strategy.getLocationsLength(); index++) { File possibleCacheLocation = strategy.getStorage(index); if (possibleCacheLocation == null) break; // bail out on the first null setFileManager(possibleCacheLocation, strategy.isCacheReadOnly(index)); if (cacheStorageManager != null) { // check this new location: File cacheFile = null; try { cacheFile = cacheStorageManager.lookup(TableReader.getTestFileName(), false); } catch (IOException e) { //Ignore the exception. The registry will be rebuilt from the xml files. } if (cacheFile != null && cacheFile.isFile()) return true; // found the appropriate location } } return false; }
protected boolean checkCache() { for (int index = 0; index < strategy.getLocationsLength(); index++) { File possibleCacheLocation = strategy.getStorage(index); if (possibleCacheLocation == null) break; // bail out on the first null setFileManager(possibleCacheLocation, strategy.isCacheReadOnly(index)); if (cacheStorageManager != null) { // check this new location: File cacheFile = null; try { cacheFile = cacheStorageManager.lookup(TableReader.getTestFileName(), false); } catch (IOException e) { //Ignore the exception. The registry will be rebuilt from the xml files. } if (cacheFile != null && cacheFile.isFile()) return true; // found the appropriate location } } return false; }