Java File Name Sanitize sanitizeFilename(String fileName)

Here you can find the source of sanitizeFilename(String fileName)

Description

sanitize Filename

License

Open Source License

Declaration

static protected String sanitizeFilename(String fileName) 

Method Source Code

//package com.java2s;
// of the GNU General Public License version 3.

public class Main {

    static protected String sanitizeFilename(String fileName) {
        if (fileName == null) {
            return null;
        }// w ww .  j  av  a  2 s .  c  o m
        return fileName.replaceAll("/", ".").replaceAll("[\\[|\\]]", " ").replaceAll(" ", "");
    }
}

Related

  1. sanitize(String fileName)
  2. sanitizeBlankNodeName(String filename)
  3. sanitizeFileName(String filename)
  4. sanitizeFilename(String filename)
  5. sanitizeFileName(String filename)
  6. sanitizeFileName(String name)
  7. sanitizeFilename(String name)
  8. sanitizeFilename(String name)