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 getFilePathOfPhoto(String photoPath, String photoName) {
        return filePathAddEndSprit(photoPath) + fileNameAddEndJPG(photoName);
    }

    public static String filePathAddEndSprit(String filePath) {
        if (null != filePath && !filePath.endsWith("/"))
            return filePath + "/";
        return filePath;
    }

    public static String fileNameAddEndJPG(String photoName) {
        if (null == photoName)
            return photoName;
        String name = photoName;
        if (!name.endsWith(".jpg"))
            name = name + ".jpg";
        return name;
    }
}