Java File Name Clean cleanFileName(String filename)

Here you can find the source of cleanFileName(String filename)

Description

Clean given 'filename' in order to be able to be used as a file name.

License

Apache License

Declaration

static String cleanFileName(String filename) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

public class Main {
    /**************************************************************************
     * Clean given 'filename' in order to be able to be used as a file
     * name.//from   w ww . ja va  2s.c o m
     **************************************************************************/
    static String cleanFileName(String filename) {
        return filename.replace(':', '.').replace('/', '_');
    }
}

Related

  1. cleanFileName(final String originalFileName)
  2. cleanFileName(final String value)
  3. cleanFileName(String arg)
  4. cleanFileName(String badFileName)
  5. cleanFilename(String filename)
  6. cleanFilename(String filename)
  7. cleanFileName(String name)
  8. cleanFileName(String name)