Sync Integ to Master
[sdc.git] / utils / DmaapPublisher / src / main / java / org / openecomp / sdc / dmaap / Util.java
1 package org.openecomp.sdc.dmaap;
2
3 import org.apache.commons.lang3.StringUtils;
4
5 import java.nio.file.InvalidPathException;
6
7 public class Util {
8
9     public static String toPath(String path , String filename) throws InvalidPathException{
10         if (StringUtils.isNotBlank(path) ){
11             if (path.trim().endsWith("/") || path.trim().endsWith("/")){
12                 return path+(filename!=null ? filename : "");
13             }
14             return path+"/"+(filename!=null ? filename : "");
15
16         }
17         throw new InvalidPathException("wrong path configuration cannot find path -> ",path);
18     }
19 }