Example usage for org.apache.commons.io FilenameUtils getFullPathNoEndSeparator

List of usage examples for org.apache.commons.io FilenameUtils getFullPathNoEndSeparator

Introduction

In this page you can find the example usage for org.apache.commons.io FilenameUtils getFullPathNoEndSeparator.

Prototype

public static String getFullPathNoEndSeparator(String filename) 

Source Link

Document

Gets the full path from a full filename, which is the prefix + path, and also excluding the final directory separator.

Usage

From source file:se.trixon.filebydate.Profile.java

public void setSourceAndDest(String[] args) {
    if (args.length == 2) {
        String source = args[0];/*from  w  w w. j  a v  a2 s . c  o  m*/
        File sourceFile = new File(source);

        if (sourceFile.isDirectory()) {
            mSourceDir = sourceFile;
            mFilePattern = "*";
        } else {
            String sourceDir = FilenameUtils.getFullPathNoEndSeparator(source);
            mSourceDir = new File(sourceDir);
            mFilePattern = FilenameUtils.getName(source);
        }

        setDestDir(new File(args[1]));
    } else {
        addValidationError(mBundle.getString("invalid_arg_count"));
    }
}