All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.okworx.ilcd.validation.util.PrefixBuilder Maven / Gradle / Ivy

Go to download

A Java library for performing technical validation of data in ILCD data format.

There is a newer version: 2.7.2
Show newest version
package com.okworx.ilcd.validation.util;

import org.apache.commons.lang3.StringUtils;

/**
 * 

PrefixBuilder class.

* * @author oliver.kusche * @version $Id: $Id */ public class PrefixBuilder { /** *

buildPrefix.

* * @param pathToJar a {@link java.lang.String} object. * @param resourcePath a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public static String buildPrefix(String pathToJar, String resourcePath) { // build "jar:file:" + pathToJar + "!/" + resourcePath; StringBuffer buf = new StringBuffer(buildPath(pathToJar, resourcePath)); if (StringUtils.isNotBlank(pathToJar) && StringUtils.isNotBlank(resourcePath) && !resourcePath.endsWith("/")) buf.append("/"); return buf.toString(); } /** *

buildPath.

* * @param pathToJar a {@link java.lang.String} object. * @param resourcePath a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public static String buildPath(String pathToJar, String resourcePath) { // build "jar:file:" + pathToJar + "!/" + resourcePath; StringBuffer buf = new StringBuffer(); if (!pathToJar.startsWith("file:")) buf.append("jar:file:"); else buf.append("jar:"); buf.append(pathToJar); buf.append("!/"); buf.append(resourcePath); return buf.toString(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy