Example usage for com.amazonaws.util StringUtils beginsWithIgnoreCase

List of usage examples for com.amazonaws.util StringUtils beginsWithIgnoreCase

Introduction

In this page you can find the example usage for com.amazonaws.util StringUtils beginsWithIgnoreCase.

Prototype

public static boolean beginsWithIgnoreCase(final String data, final String seq) 

Source Link

Document

Performs a case insensitive comparison and returns true if the data begins with the given sequence.

Usage

From source file:com.netflix.genie.core.services.impl.LocalFileTransferImpl.java

License:Apache License

private Path createFilePath(final String path) throws GenieServerException {
    log.debug("Normalizing path from {}", path);
    final String finalPath;
    if (StringUtils.beginsWithIgnoreCase(path, ENTIRE_FILE_SCHEME)) {
        finalPath = path;//from ww w. j  a  v a2 s.c  o  m
    } else if (StringUtils.beginsWithIgnoreCase(path, FILE_SCHEME)) {
        finalPath = path.replace(FILE_SCHEME, ENTIRE_FILE_SCHEME);
    } else {
        finalPath = ENTIRE_FILE_SCHEME + path;
    }
    log.debug("Final path of {} after normalization is {}", path, finalPath);

    try {
        return Paths.get(new URI(finalPath));
    } catch (final IllegalArgumentException | URISyntaxException e) {
        log.error("Unable to convert {} to java.nio.file.Path due to {}", finalPath, e.getMessage(), e);
        throw new GenieServerException("Failed to get file path", e);
    }
}