<code>optional string ufsPath = 4;</code>
191934
public com.google.protobuf.ByteString
      getUfsPathBytes() {
    java.lang.Object ref = ufsPath_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      ufsPath_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
929477
public static URI stringAsURI(String s) throws IOException {
    URI u = null;
    // try to make a URI
    try {
      u = new URI(s);
    } catch (URISyntaxException e){
      LOG.error("Syntax error in URI " + s
          + ". Please check hdfs configuration.", e);
    }

    // if URI is null or scheme is undefined, then assume it's file://
    if(u == null || u.getScheme() == null){
      LOG.warn("Path " + s + " should be specified as a URI "
          + "in configuration files. Please update hdfs configuration.");
      u = fileAsURI(new File(s));
    }
    return u;
  }
212928
public com.google.protobuf.ByteString
      getUfsUriBytes() {
    java.lang.Object ref = ufsUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      ufsUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
580748
public static Path sourcePathFromParityPath(Path parityPath, FileSystem fs) 
        throws IOException {
    String parityPathStr = parityPath.toUri().getPath();
    for (Codec codec : Codec.getCodecs()) {
      String prefix = codec.getParityPrefix();
      if (parityPathStr.startsWith(prefix)) {
        // Remove the prefix to get the source file.
        String src = parityPathStr.replaceFirst(prefix, Path.SEPARATOR);
        Path srcPath = new Path(src);
        if (fs.exists(srcPath)) {
          return srcPath;
        }
      }
    }
    return null;
  }
363555
public static String getPathsString(Collection<VirtualFile> paths) {
        if (paths == null) {
            throw MESSAGES.nullArgument("paths");
        }
        StringBuilder buffer = new StringBuilder();
        boolean first = true;
        for (VirtualFile path : paths) {
            if (path == null) { throw new IllegalArgumentException("Null path in " + paths); }
            if (first == false) {
                buffer.append(':');
            } else {
                first = false;
            }
            buffer.append(path.getPathName());
        }
        if (first == true) {
            buffer.append("<empty>");
        }
        return buffer.toString();
    }
686525
public static Path serialize(Object source, FileSystem fs, Path targetPath) {
		Assert.notNull(targetPath, "'targetPath' must not be null");
		Assert.notNull(fs, "'fs' must not be null");
		Assert.notNull(source, "'source' must not be null");

		Path resultPath = targetPath.makeQualified(fs.getUri(), fs.getWorkingDirectory());
		OutputStream targetOutputStream = null;
		try {
			targetOutputStream = fs.create(targetPath);
			SerializationUtils.serialize(source, targetOutputStream);
		}
		catch (Exception e) {
			throw new IllegalStateException("Failed to serialize " + source + " to " + resultPath, e);
		}
		return resultPath;
	}
362370
public static Optional<List<String>> getStringListAsOptWithClasspath(
            String classpathOrFilePath) {
        return getResourceInputStreamAsOpt(classpathOrFilePath)
                .map(JMInputStream::readLines);
    }
34732
static String uri(final String... paths) {
        StringBuilder sb = new StringBuilder();
        boolean firstPath = true;
        for (String s : paths) {
            if (s == null || s.isEmpty()) {
                continue;
            }
            if (!s.startsWith("/") && !firstPath) {
                sb.append("/");
            }
            sb.append(stripLeadingSlash(s));
            firstPath = false;
        }
        return sb.toString();
    }
1108919
public static String encodeURIPathComponent(String s) {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < s.length(); i++) {
      result.append(Char.encodeURIPathComponent(s.charAt(i)));
    }
    return (result.toString());
  }
807418
public PathImpl fsWalk(String userPath,
                     Map<String,Object> attributes,
                     String uri)
  {
    String path;
    String query = null;
    int queryIndex = uri.indexOf('?');
    if (queryIndex >= 0) {
      path = uri.substring(0, queryIndex);
      query = uri.substring(queryIndex + 1);
    } else
      path = uri;

    if (path.length() == 0)
      path = "/";

    return create(_root, userPath, attributes, path, query);
  }
360042
public Optional<Path> getSourcePath() {
    File f = this.nytdoc.getSourceFile();
    return f == null ? Optional.empty() : Optional.of(f.toPath());
  }
1128974
public String toPathString() {
        return toString(pathSegment -> {
            final Optional<String> var = pathSegment.getVariable();
            if (var.isPresent()) {
                final Optional<UriMatchVariable> umv = variables.stream()
                        .filter(v -> v.getName().equals(var.get())).findFirst();
                if (umv.isPresent()) {
                    final UriMatchVariable uriMatchVariable = umv.get();
                    if (uriMatchVariable.isQuery()) {
                        return false;
                    }
                }
            }
            return true;
        });
    }
372634
public Optional<String[]> splitPath(URI resource) {
        int matchRes = matches(resource);
        if (matchRes < 0) {
            return Optional.empty();
        }
        return Optional.of(split(resource.getPath(), matchRes + 1));
    }
529184
public static String decodePath(String path, int offset, int length) {
        try {
            Utf8StringBuilder builder = null;
            int end = offset + length;
            for (int i = offset; i < end; i++) {
                char c = path.charAt(i);
                switch (c) {
                    case '%':
                        if (builder == null) {
                            builder = new Utf8StringBuilder(path.length());
                            builder.append(path, offset, i - offset);
                        }
                        if ((i + 2) < end) {
                            char u = path.charAt(i + 1);
                            if (u == 'u') {
                                // TODO this is wrong. This is a codepoint not a char
                                builder.append((char) (0xffff & TypeUtils.parseInt(path, i + 2, 4, 16)));
                                i += 5;
                            } else {
                                builder.append((byte) (0xff & (TypeUtils.convertHexDigit(u) * 16 + TypeUtils.convertHexDigit(path.charAt(i + 2)))));
                                i += 2;
                            }
                        } else {
                            throw new IllegalArgumentException("Bad URI % encoding");
                        }

                        break;

                    case ';':
                        if (builder == null) {
                            builder = new Utf8StringBuilder(path.length());
                            builder.append(path, offset, i - offset);
                        }

                        while (++i < end) {
                            if (path.charAt(i) == '/') {
                                builder.append('/');
                                break;
                            }
                        }

                        break;

                    default:
                        if (builder != null)
                            builder.append(c);
                        break;
                }
            }

            if (builder != null)
                return builder.toString();
            if (offset == 0 && length == path.length())
                return path;
            return path.substring(offset, end);
        } catch (NotUtf8Exception e) {
            System.err.println(path.substring(offset, offset + length) + " " + e);
            return decodeISO88591Path(path, offset, length);
        }
    }
54517
public static String getPathFromString(String filePath) {
        String newPath = filePath;

        int forwardInd = filePath.lastIndexOf("/");
        int backInd = filePath.lastIndexOf("\\");

        if (forwardInd > backInd) {
            newPath = filePath.substring(0, forwardInd + 1);
        } else {
            newPath = filePath.substring(0, backInd + 1);
        }

        // still original if no occurance of "/" or "\"
        return newPath;
    }
1303368
@Override
	public String getAbsolutePath() {

		try (Tx tx = StructrApp.getInstance().tx()) {

			final String path = page.getPath();
			tx.success();

			return path;

		} catch (FrameworkException fex) {
			logger.error("Error in getPath() of abstract ftp file", fex);
		}
		return null;
	}
1222423
public static String getFileAbsoluteUri(String filePath){
		String fileAbsoluteUri = filePath;
		if (!filePath.startsWith("file://")){
			fileAbsoluteUri = "file://".concat(filePath);
		}	
		return fileAbsoluteUri;		
	}