@Test public void convertWithString() throws Exception { String value = "attach:Toto.WebHome@testvfs.zip VfsResourceReference expectedReference = new VfsResourceReference(URI.create(value)); assertEquals(expectedReference, this.vfsResourceReferenceConverter.convertToType(null, value)); }
@Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; }
VfsResourceReferenceConverter extends AbstractConverter<VfsResourceReference> { @Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; } }
VfsResourceReferenceConverter extends AbstractConverter<VfsResourceReference> { @Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; }  }
VfsResourceReferenceConverter extends AbstractConverter<VfsResourceReference> { @Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; }   }
VfsResourceReferenceConverter extends AbstractConverter<VfsResourceReference> { @Override protected VfsResourceReference convertToType(Type targetType, Object value) { if (value == null) { return null; } VfsResourceReference reference; try { reference = new VfsResourceReference(value.toString()); } catch (Exception e) { throw new ConversionException( String.format("Failed to convert [%s] to a VFS Resource Reference", value), e); } return reference; }    }