Java Path Combine combinePath(String basePath, String withPath)

Here you can find the source of combinePath(String basePath, String withPath)

Description

combine Path

License

Open Source License

Declaration

public static String combinePath(String basePath, String withPath) 

Method Source Code

//package com.java2s;
//  License: https://servicestack.net/bsd-license.txt

public class Main {
    public static String combinePath(String basePath, String withPath) {
        if (basePath == null)
            basePath = "";
        if (withPath == null)
            withPath = "";

        String prefix = basePath.endsWith("/") ? basePath : basePath + "/";

        String suffix = withPath.startsWith("/") ? withPath.substring(1) : withPath;

        return prefix + suffix;
    }//www .  j  a  va  2s .co m
}

Related

  1. combine(final String path, final String suffix)
  2. combine(final String path1, final String path2)
  3. combine(String directory, String filename)
  4. combineDisplayPaths(String parent_display, String display_path)
  5. combinePath(java.io.File parentDir, String... childDirs)
  6. combinePath(String parent, String child)
  7. combinePath(String parent, String name)
  8. combinePath(String part0, String... parts)
  9. combinePath(String path1, String path2)