Java Directory Clean cleanPaths(String root, String rel, String name)

Here you can find the source of cleanPaths(String root, String rel, String name)

Description

clean Paths

License

Apache License

Declaration

public static String cleanPaths(String root, String rel, String name) 

Method Source Code


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

import java.io.File;

public class Main {
    public static String cleanPaths(String root, String rel, String name) {
        //ideal:/*from w  w w . j ava  2 s . com*/
        //Root + File.separator + Rel + File.separator + Name
        String complete = null;
        if (root != null) {
            complete = root;
        }
        if (rel != null) {
            if (complete != null)
                complete = complete + File.separator + rel;
            else
                complete = rel;
        }
        if (name != null) {
            if (complete != null)
                complete = complete + File.separator + name;
            else
                complete = name;
        }
        return complete;
    }
}

Related

  1. cleanDir(String directory)
  2. cleanDir(String path)
  3. cleanDirectory(File currentDir)
  4. cleanPath(String loc)
  5. cleanPath(String path)
  6. clearDir(File dir, boolean clearsubdirs)
  7. clearDir(String dirPath)