Java Path Create nio createFullURI(String val, Path parent)

Here you can find the source of createFullURI(String val, Path parent)

Description

create Full URI

License

Apache License

Declaration

private static URI createFullURI(String val, Path parent) throws URISyntaxException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URI;
import java.net.URISyntaxException;

import java.nio.file.Path;

public class Main {
    private static URI createFullURI(String val, Path parent) throws URISyntaxException {
        URI uri = URI.create(val.replace(" ", "%20"));
        if (uri.getScheme() == null) {
            uri = new URI("file", val, null);
        }/*w w w  .  j a  va2  s  .c  om*/
        if (uri.isOpaque()) {
            uri = new URI("file", parent.resolve(val).toAbsolutePath().toString(), null);
        }
        return uri;
    }
}

Related

  1. createFileIfNotExists(Path path)
  2. createFileRelativeToClasspath(String resourceName)
  3. createFileWithContents(String pathString, String contents)
  4. createFolder(String workspacePath)
  5. createFoldersIfNecessary(String workspacePath)
  6. createGlobMatcher(final Path path)
  7. createHeader(Path newFile)
  8. createHiddenFile(String filePath)
  9. createIncrNonExistentFilename(final Path parent, final String prefix, final String suffix)