Example usage for org.springframework.core.io VfsResource VfsResource

List of usage examples for org.springframework.core.io VfsResource VfsResource

Introduction

In this page you can find the example usage for org.springframework.core.io VfsResource VfsResource.

Prototype

public VfsResource(Object resource) 

Source Link

Document

Create a new VfsResource wrapping the given resource handle.

Usage

From source file:com.javaetmoi.core.spring.vfs.Vfs2Resource.java

@Override
public Resource createRelative(String relativePath) throws IOException {
    if (!relativePath.startsWith(".") && relativePath.contains("/")) {
        try {/*from  w  w w . ja  v a 2 s .  c  om*/
            return new VfsResource(Vfs2Utils.getChild(this.resource, relativePath));
        } catch (IOException ex) {
            // fall back to getRelative
        }
    }

    return new VfsResource(Vfs2Utils.getRelative(new URL(getURL(), relativePath)));
}