Search in sources :

Example 1 with DefaultResourceLoader

use of com.revolsys.spring.resource.DefaultResourceLoader in project com.revolsys.open by revolsys.

the class MavenRepository method setRoot.

public void setRoot(final Resource root) {
    if (root == null) {
        this.root = new PathResource(System.getProperty("user.home") + "/.m2/repository/");
    } else {
        try {
            String url = root.getURL().toExternalForm();
            url = url.replaceAll("([^(:/{2,3)])//+", "$1/");
            if (!url.endsWith("/")) {
                url += '/';
            }
            this.root = new DefaultResourceLoader().getResource(url);
        } catch (final Throwable e) {
            this.root = root;
        }
    }
}
Also used : PathResource(com.revolsys.spring.resource.PathResource) DefaultResourceLoader(com.revolsys.spring.resource.DefaultResourceLoader)

Aggregations

DefaultResourceLoader (com.revolsys.spring.resource.DefaultResourceLoader)1 PathResource (com.revolsys.spring.resource.PathResource)1