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 getImageNetPath(String path, String domain) {
        if (path.startsWith("http://")) {
            return path;
        } else {
            if (domain.endsWith("/") && path.startsWith("/")) {
                return domain + path.substring(1);
            } else if (!domain.endsWith("/") && path.startsWith("/")) {
                return domain + path;
            } else if (domain.endsWith("/") && !path.startsWith("/")) {
                return domain + path;
            } else {
                return domain + "/" + path;
            }
        }
    }
}