Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class Main {

    public static String getFilePath(File dirPath, String fileName) {
        try {
            String filePath = dirPath.getAbsolutePath() + File.separator
                    + URLEncoder.encode(fileName.replace("*", ""), "UTF-8");
            return filePath;
        } catch (final UnsupportedEncodingException e) {
            e.printStackTrace();
        }

        return null;

    }
}