com.github.easypack.io.PathSeparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easypack-maven-plugin Show documentation
Show all versions of easypack-maven-plugin Show documentation
Maven plugin for building Java applications in tar, zip and tar.gz format.
The newest version!
package com.github.easypack.io;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
/**
* Handles the path separator character.
*
* @author agusmunioz
*
*/
public class PathSeparator {
/**
* Maps a OS separator to the 'opposite'.
*/
private static Map SLASH_TRANSFORM = new HashMap();
static {
SLASH_TRANSFORM.put("/", "\\");
SLASH_TRANSFORM.put("\\", "/");
}
/**
* Gets the host operating system file separator character.
*
* @return the separator character.
*/
public static String get() {
return File.separator;
}
/**
* Migrates a separator character form one operating system to another.
*
* @param separator
* the separator character.
*
* @return the separator in the other operating system.
*/
public static String migrate(String separator) {
return SLASH_TRANSFORM.get(separator);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy