@Test public void testRequiredPathParameterRead() { try { Properties parameters = new Properties(); FileStorageConnector connector = new FileStorageConnector(parameters); connector.read(parameters); fail("Should not allow null path parameter"); } catch (Exception ex) { } }
@Override public InputStream read(Properties parameters) throws Exception { String fileRef = getFilePath(parameters); ArgCheck.isNotNull(fileRef, "RelativeFileRef"); File destFile = new File(getPath(), fileRef); if (destFile.exists()) return new FileInputStream(destFile); throw new FileNotFoundException(); }
FileStorageConnector implements StorageConnector { @Override public InputStream read(Properties parameters) throws Exception { String fileRef = getFilePath(parameters); ArgCheck.isNotNull(fileRef, "RelativeFileRef"); File destFile = new File(getPath(), fileRef); if (destFile.exists()) return new FileInputStream(destFile); throw new FileNotFoundException(); } }
FileStorageConnector implements StorageConnector { @Override public InputStream read(Properties parameters) throws Exception { String fileRef = getFilePath(parameters); ArgCheck.isNotNull(fileRef, "RelativeFileRef"); File destFile = new File(getPath(), fileRef); if (destFile.exists()) return new FileInputStream(destFile); throw new FileNotFoundException(); } FileStorageConnector(Properties parameters); }
FileStorageConnector implements StorageConnector { @Override public InputStream read(Properties parameters) throws Exception { String fileRef = getFilePath(parameters); ArgCheck.isNotNull(fileRef, "RelativeFileRef"); File destFile = new File(getPath(), fileRef); if (destFile.exists()) return new FileInputStream(destFile); throw new FileNotFoundException(); } FileStorageConnector(Properties parameters); @Override StorageConnectorId getId(); @Override Set<Descriptor> getDescriptors(); String getPath(); String getFilePath(Properties parameters); @Override InputStream read(Properties parameters); @Override void write(Exportable artifact, UnitOfWork transaction, Properties parameters); @Override boolean refresh(); @Override StorageTree<String> browse(); @Override void dispose(); }
FileStorageConnector implements StorageConnector { @Override public InputStream read(Properties parameters) throws Exception { String fileRef = getFilePath(parameters); ArgCheck.isNotNull(fileRef, "RelativeFileRef"); File destFile = new File(getPath(), fileRef); if (destFile.exists()) return new FileInputStream(destFile); throw new FileNotFoundException(); } FileStorageConnector(Properties parameters); @Override StorageConnectorId getId(); @Override Set<Descriptor> getDescriptors(); String getPath(); String getFilePath(Properties parameters); @Override InputStream read(Properties parameters); @Override void write(Exportable artifact, UnitOfWork transaction, Properties parameters); @Override boolean refresh(); @Override StorageTree<String> browse(); @Override void dispose();  }