Java Path String Clean filePathReplaceAll(String value)

Here you can find the source of filePathReplaceAll(String value)

Description

file Path Replace All

License

Apache License

Declaration

public static String filePathReplaceAll(String value) 

Method Source Code

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

public class Main {

    public static String filePathReplaceAll(String value) {
        String returnValue = value;
        if (returnValue == null || returnValue.trim().equals("")) {
            return "";
        }//  w  w w . ja v  a  2 s.co  m

        returnValue = returnValue.replaceAll("/", "");
        returnValue = returnValue.replaceAll("\\", "");
        returnValue = returnValue.replaceAll("\\.\\.", ""); // ..
        returnValue = returnValue.replaceAll("&", "");

        return returnValue;
    }
}

Related

  1. cleanPath(String path)
  2. cleanPath(String path, boolean trimStartSeparator)
  3. cleanPath(String s)
  4. cleanPath(String sText, boolean isWindows)
  5. cleanPathSegment(final String toClean)
  6. filePathTail(String filePath)