/*
 * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.wso2.carbon.uis.internal.io.util;

import org.apache.commons.io.FilenameUtils;

import java.nio.file.Path;

/**
 * Created by sajith on 8/30/17.
 */
public class PathUtils {

    public static String getName(Path path) {
        Path fileName = path.getFileName();
        return (fileName == null) ? "" : fileName.toString();
    }

    public static String getExtension(Path filePath) {
        return FilenameUtils.getExtension(filePath.getFileName().toString());
    }
}

@@ -798,226 +798,599 @@
 %0A * 
-Created by sajith on 8/30/17.%0A */%0Apublic class PathUtils %7B%0A%0A    public static String getName(Path path) %7B%0A        Path fileName = path.getFileName();%0A        return (fileName == null) ? %22%22 : fileName.toString();%0A    %7D%0A
+Utility methods for %7B@link Path%7Ds.%0A *%0A * @since 0.8.0%0A */%0Apublic class PathUtils %7B%0A%0A    private PathUtils() %7B%0A    %7D%0A%0A    /**%0A     * Returns the file name of the given path.%0A     *%0A     * @param path file/directory path%0A     * @return file name (never %7B@code null%7D)%0A     */%0A    public static String getName(Path path) %7B%0A        Path fileName = path.getFileName();%0A        return (fileName == null) ? %22%22 : fileName.toString();%0A    %7D%0A%0A    /**%0A     * Returns the file extension of the given path.%0A     *%0A     * @param filePath file path%0A     * @return file extension (never %7B@code null%7D)%0A     */
 %0A   

fix javadocs in PathUtils class