Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String getFileNameFromUri(String uri) {
        String file = "";
        int lastIndexOfSlash = -1;
        if (uri != null && !uri.isEmpty()) {
            lastIndexOfSlash = uri.lastIndexOf('/');
            if (lastIndexOfSlash > -1)
                file = uri.substring(uri.lastIndexOf('/'), uri.length());
        }
        return file;
    }
}