Example usage for org.apache.wicket.request.resource ResourceReference ResourceReference

List of usage examples for org.apache.wicket.request.resource ResourceReference ResourceReference

Introduction

In this page you can find the example usage for org.apache.wicket.request.resource ResourceReference ResourceReference.

Prototype

public ResourceReference(Class<?> scope, String name) 

Source Link

Document

Creates new ResourceReference instance.

Usage

From source file:org.cast.cwm.dav.DavResource.java

License:Open Source License

/** Return a ResourceReference to a relatively-addressed item
 * //  ww w  .  j  ava 2 s.com
 * @param relativePath path relative to the path of this Resource
 * @return a ResourceReference that will resolve to {@link #getRelative(relativePath)}
 */
@Override
public ResourceReference getRelativeReference(final String relativePath) {
    String childPath = path.substring(1, path.lastIndexOf('/') + 1) + relativePath;
    return new ResourceReference(DavResource.class, childPath) {
        private static final long serialVersionUID = 1L;

        @Override
        public IResource getResource() {
            return getRelativeResource(relativePath);
        }
    };
}

From source file:org.cast.cwm.xml.FileResource.java

License:Open Source License

/** Return a ResourceReference to a relatively-addressed item
 * /*w ww . j  a v a  2s. com*/
 * @param relativePath path relative to the path of this Resource
 * @return a ResourceReference that will resolve to {@link #getRelative(relativePath)}
 */
@Override
public ResourceReference getRelativeReference(final String relativePath) {
    String filePath = getRelativeFile(relativePath).getAbsolutePath().substring(1);
    return new ResourceReference(FileResource.class, filePath) {
        private static final long serialVersionUID = 1L;

        @Override
        public IResource getResource() {
            return getRelativeResource(relativePath);
        }
    };
}

From source file:org.cast.cwm.xml.FileXmlDocumentSource.java

License:Open Source License

/** Return a ResourceReference to a relatively-addressed item
 * //ww  w. j  a  v a  2s . com
 * @param relativePath path relative to the path of this Resource
 * @return a ResourceReference that will resolve to {@link #getRelative(relativePath)}
 */
@Override
public ResourceReference getRelativeReference(final String relativePath) {
    String filePath = new File(file.getParentFile(), relativePath).getAbsolutePath().substring(1);
    return new ResourceReference(FileXmlDocumentSource.class, filePath) {
        private static final long serialVersionUID = 1L;

        @Override
        public IResource getResource() {
            return getRelativeResource(relativePath);
        }
    };
}