@Test(expected = NotfoundException.class) public void testFindNotFound() throws Exception { try { new MantaAttributesFinderFeature(session).find(randomFile()); } catch(NotfoundException e) { assertEquals("Not Found. Please contact your web hosting service provider for assistance.", e.getDetail()); throw e; } }
@Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { return new MantaObjectAttributeAdapter(session) .convert(session.getClient().head(file.getAbsolute())); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file); } }
MantaAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { return new MantaObjectAttributeAdapter(session) .convert(session.getClient().head(file.getAbsolute())); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } }
MantaAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { return new MantaObjectAttributeAdapter(session) .convert(session.getClient().head(file.getAbsolute())); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } MantaAttributesFinderFeature(final MantaSession session); }
MantaAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { return new MantaObjectAttributeAdapter(session) .convert(session.getClient().head(file.getAbsolute())); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } MantaAttributesFinderFeature(final MantaSession session); @Override PathAttributes find(final Path file); }
MantaAttributesFinderFeature implements AttributesFinder { @Override public PathAttributes find(final Path file) throws BackgroundException { if(file.isRoot()) { return PathAttributes.EMPTY; } try { return new MantaObjectAttributeAdapter(session) .convert(session.getClient().head(file.getAbsolute())); } catch(MantaException e) { throw new MantaExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(MantaClientHttpResponseException e) { throw new MantaHttpExceptionMappingService().map("Failure to read attributes of {0}", e, file); } catch(IOException e) { throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file); } } MantaAttributesFinderFeature(final MantaSession session); @Override PathAttributes find(final Path file);  }