@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new InputSource(resource.getURL().toString()) : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getURL() : null); } catch (IOException ex) { throw new IllegalArgumentException("Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getInputStream() : null); } catch (IOException ex) { throw new IllegalArgumentException("Failed to retrieve InputStream for " + resource, ex); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new InputSource(resource.getURL().toString()) : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getURL() : null); } catch (IOException ex) { throw new IllegalArgumentException("Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getInputStream() : null); } catch (IOException ex) { throw new IllegalArgumentException("Failed to retrieve InputStream for " + resource, ex); } }
this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); if (resource == null) {
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new EncodedResource(resource).getReader() : null); } catch (IOException ex) { throw new IllegalArgumentException("Failed to retrieve Reader for " + resource, ex); } }
this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue();
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new EncodedResource(resource).getReader() : null); } catch (IOException ex) { throw new IllegalArgumentException("Failed to retrieve Reader for " + resource, ex); } }
this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); if (resource == null) {
this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue();
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new InputSource(resource.getURL().toString()) : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getURL() : null); } catch (IOException ex) { throw new IllegalArgumentException("Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getInputStream() : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve InputStream for " + resource + ": " + ex.getMessage()); } }
this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue();
@Override public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? new InputSource(resource.getURL().toString()) : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
public void setAsText(String text) throws IllegalArgumentException { this.resourceEditor.setAsText(text); Resource resource = (Resource) this.resourceEditor.getValue(); try { setValue(resource != null ? resource.getURL() : null); } catch (IOException ex) { throw new IllegalArgumentException( "Could not retrieve URL for " + resource + ": " + ex.getMessage()); } }
public static String base64Image(String resourceAsText, String type) throws IOException { ResourceEditor editor = new ResourceEditor(); editor.setAsText(resourceAsText); Resource resource = (Resource) editor.getValue(); BufferedImage img = ImageIO.read(resource.getFile()); return encodeToString(img, type); }
public void setLocations(String[] locations) { super.setLocations(locations); ResourceEditor editor = (ResourceEditor) BeanUtils.findEditorByConvention(Resource.class); Resource[] resources = new Resource[locations.length]; for (int i = 0; i < locations.length; i++) { editor.setAsText(locations[i]); resources[i] = (Resource) editor.getValue(); } eppc.setLocations(resources); }