Example usage for org.springframework.core.io WritableResource exists

List of usage examples for org.springframework.core.io WritableResource exists

Introduction

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

Prototype

boolean exists();

Source Link

Document

Determine whether this resource actually exists in physical form.

Usage

From source file:org.mitre.mpf.wfm.util.PropertiesUtil.java

private static WritableResource getDataResource(WritableResource dataResource,
        InputStreamSource templateResource) {
    if (dataResource.exists()) {
        return dataResource;
    }/*from  www  . ja  v a  2  s  .c om*/

    try {
        log.info("{} doesn't exist. Copying from {}", dataResource, templateResource);
        copyResource(dataResource, templateResource);
        return dataResource;
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}