@Test public void testGetFileName() throws Exception { StaticFileServiceImpl staticFileServiceImpl = new StaticFileServiceImpl(); staticFileServiceImpl.setOrganizationDirectoryService(orgDir); staticFileServiceImpl.activate(getComponentContext(null)); staticFileServiceImpl.setSecurityService(getSecurityService()); String imageUUID = staticFileServiceImpl.storeFile(imageFilename, new FileInputStream(imageFile)); assertEquals(imageFile.getName(), staticFileServiceImpl.getFileName(imageUUID)); }
@Override public String getFileName(String uuid) throws NotFoundException { final String org = securityService.getOrganization().getId(); try { Path file = getFile(org, uuid); return file.getFileName().toString(); } catch (IOException e) { logger.warn("Error while reading file:", e); throw new NotFoundException(e); } }
StaticFileServiceImpl implements StaticFileService { @Override public String getFileName(String uuid) throws NotFoundException { final String org = securityService.getOrganization().getId(); try { Path file = getFile(org, uuid); return file.getFileName().toString(); } catch (IOException e) { logger.warn("Error while reading file:", e); throw new NotFoundException(e); } } }
StaticFileServiceImpl implements StaticFileService { @Override public String getFileName(String uuid) throws NotFoundException { final String org = securityService.getOrganization().getId(); try { Path file = getFile(org, uuid); return file.getFileName().toString(); } catch (IOException e) { logger.warn("Error while reading file:", e); throw new NotFoundException(e); } }  }
StaticFileServiceImpl implements StaticFileService { @Override public String getFileName(String uuid) throws NotFoundException { final String org = securityService.getOrganization().getId(); try { Path file = getFile(org, uuid); return file.getFileName().toString(); } catch (IOException e) { logger.warn("Error while reading file:", e); throw new NotFoundException(e); } }  void activate(ComponentContext cc); void deactivate(); void setSecurityService(SecurityService securityService); void setOrganizationDirectoryService(OrganizationDirectoryService directoryService); @Override String storeFile(String filename, InputStream inputStream); @Override InputStream getFile(final String uuid); @Override void persistFile(final String uuid); @Override void deleteFile(String uuid); @Override String getFileName(String uuid); @Override Long getContentLength(String uuid); }
StaticFileServiceImpl implements StaticFileService { @Override public String getFileName(String uuid) throws NotFoundException { final String org = securityService.getOrganization().getId(); try { Path file = getFile(org, uuid); return file.getFileName().toString(); } catch (IOException e) { logger.warn("Error while reading file:", e); throw new NotFoundException(e); } }  void activate(ComponentContext cc); void deactivate(); void setSecurityService(SecurityService securityService); void setOrganizationDirectoryService(OrganizationDirectoryService directoryService); @Override String storeFile(String filename, InputStream inputStream); @Override InputStream getFile(final String uuid); @Override void persistFile(final String uuid); @Override void deleteFile(String uuid); @Override String getFileName(String uuid); @Override Long getContentLength(String uuid); static final String STATICFILES_ROOT_DIRECTORY_KEY; }