/** * @see org.apache.wicket.util.resource.IResourceStream#getContentType() */ public String getContentType() { checkLoadData(); return data.getContentType(); }
/** * @see org.apache.wicket.util.resource.IResourceStream#length() */ public long length() { checkLoadData(); return (data != null) ? data.getLength() : 0; }
/** * @see org.apache.wicket.util.watch.IModifiable#lastModifiedTime() */ public Time lastModifiedTime() { checkLoadData(); return data.lastModifiedTime(); }
/** * read string with platform default encoding from resource stream * * @param resourceStream * @return string read from resource stream * * @see #readString(org.apache.wicket.util.resource.IResourceStream, java.nio.charset.Charset) */ public static String readString(IResourceStream resourceStream) { return readString(resourceStream, null); }
/** * Get the property factory which will be used to load property files * * @return PropertiesFactory */ public org.apache.wicket.resource.IPropertiesFactory getPropertiesFactory() { if (propertiesFactory == null) { propertiesFactory = new PropertiesFactory(this); } return propertiesFactory; }
/** * Creates a new resource response and reads the given path */ @Override protected ResourceResponse newResourceResponse(Attributes attributes) { return createResourceResponse(attributes, getPath()); }
/** * Check whether the data was loaded yet. If not, load it now. */ private void checkLoadData() { if (data == null) { data = getResourceState(); } } };
/** * Creates a dynamic resource */ public DynamicByteArrayResource() { super(); setCacheable(false); }
/** * @return The length of the data */ public int getLength() { byte[] data = getData(); return data != null ? data.length : 0; } }
/** * Creates a new file system resource based on the given path * * @param path * the path to be read for the resource */ public FileSystemResource(Path path) { this.path = new PathModel(path); }
/** * Creates a new {@link org.apache.wicket.markup.html.media.FileSystemResource} and applies the * path to it. */ @Override public IResource getResource() { return getFileSystemResource(); }
/** * @see org.apache.wicket.util.resource.IResourceStream#getContentType() */ public String getContentType() { checkLoadData(); return data.getContentType(); }
/** * @see org.apache.wicket.util.resource.IResourceStream#length() */ public long length() { checkLoadData(); return (data != null) ? data.getLength() : 0; }
/** * @see org.apache.wicket.util.watch.IModifiable#lastModifiedTime() */ public Time lastModifiedTime() { checkLoadData(); return data.lastModifiedTime(); }
/** * read string with platform default encoding from resource stream * * @param resourceStream * @return string read from resource stream * * @see #readString(org.apache.wicket.util.resource.IResourceStream, java.nio.charset.Charset) */ public static String readString(IResourceStream resourceStream) { return readString(resourceStream, null); }
/** * Creates a new resource response and reads the given path */ @Override protected ResourceResponse newResourceResponse(Attributes attributes) { return createResourceResponse(attributes, getPath()); }
/** * Check whether the data was loaded yet. If not, load it now. */ private void checkLoadData() { if (data == null) { data = getResourceState(); } } };
/** * Creates a dynamic resource */ public DynamicByteArrayResource() { super(); setCacheable(false); }
/** * Creates a new file system resource based on the given path * * @param path * the path to be read for the resource */ public FileSystemResource(Path path) { this.path = new PathModel(path); }
/** * Creates a new {@link org.apache.wicket.markup.html.media.FileSystemResource} and applies the * path to it. */ @Override public IResource getResource() { return getFileSystemResource(); }