Example usage for java.io File separatorChar

List of usage examples for java.io File separatorChar

Introduction

In this page you can find the example usage for java.io File separatorChar.

Prototype

char separatorChar

To view the source code for java.io File separatorChar.

Click Source Link

Document

The system-dependent default name-separator character.

Usage

From source file:com.appleframework.jmx.core.util.CoreUtils.java

public static String getDashboardsDir() {
    return getRootDir() + File.separatorChar + "dashboards";
}

From source file:hu.bme.mit.sette.common.util.JavaFileUtils.java

/**
 * Converts a filename to a Java package name by transliterating the file
 * separator characters to the package separator character.
 *
 * @param filename/*from  w w w  .j  av a 2 s.  c  o m*/
 *            The filename (e.g. hu/bme/mit/sette)
 * @return The package name (e.g. hu.bme.mit.sette)
 */
public static String filenameToPackageName(final String filename) {
    return StringUtils.replaceChars(filename, File.separatorChar, JavaFileUtils.PACKAGE_SEPARATOR);
}

From source file:com.igormaznitsa.jcp.usecases.AbstractUseCaseTest.java

@Before
public void before() throws Exception {

    final File testDir = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI());

    final File base = new File(testDir, this.getClass().getName().replace('.', File.separatorChar));

    final File simulfolder = new File(testDir.getParentFile(), "usecase_tests");
    if (!simulfolder.isDirectory()) {
        assertTrue("Can't make folders for simulation", simulfolder.mkdirs());
    }/*from ww w  .j a v a  2  s  . co m*/

    tmpResultFolder = new TemporaryFolder(simulfolder);
    tmpResultFolder.create();

    sourceFolder = new File(base, "src");
    etalonFolder = new File(base, "etl");
}

From source file:com.igormaznitsa.mindmap.model.ExtraFile.java

@Nonnull
private static String ensureFolderPath(@Nonnull final String str) {
    if (str.endsWith("/") || str.endsWith("\\"))
        return str;
    return str + File.separatorChar;
}

From source file:com.quatico.base.aem.test.api.values.TestFile.java

public static String path(String... segments) {
    StringBuilder buf = new StringBuilder();
    for (int count = 0, idx = 0; idx < segments.length; idx++) {
        String cur = segments[idx];
        if (StringUtils.isBlank(cur) && count == 0 || StringUtils.isNotBlank(cur) && buf.length() > 1) {
            buf.append(File.separator);
        }//from   w w w.  j  av a2  s  .  com
        if (StringUtils.isNotBlank(cur)) {
            buf.append(cur);
        }
        count++;
    }
    String result = buf.toString();
    if (result.matches("^\\\\[\\w]{1}:")) { // java.io.File cannot handle leading slashes before drive letters on Windows
        result = result.substring(1);
    }
    return result.replace(ILLEGAL_FILE_SEPARATOR, File.separatorChar);
}

From source file:OS.java

public static boolean isWindows() {
    return File.separatorChar == '\\';
}

From source file:JarMaker.java

public static boolean utilityPack(String p_utilityFileName, String jarName) {

    try {//from  ww w .  j  a  va2  s.  c  om
        // begin to pack the utility jar file.
        String t_utilityfilename = p_utilityFileName.replace('\\', File.separatorChar);
        String t_jarfilename = jarName.replace('\\', File.separatorChar) + ".jar";
        // File utilityFile = new File(p_utilityFileName);
        RealPackUtilityJar(t_utilityfilename, t_jarfilename);
        // delete the utility directory!
    } catch (Exception ex) {
        return false;
    }
    return true;
}

From source file:ar.com.tadp.xml.rinzo.core.utils.FileUtils.java

public static String relPathToUrl(String s) {
    char c = File.separatorChar;
    return c == '/' ? s : s.replace(c, '/');
}

From source file:de.uni_rostock.goodod.test.BasicImportingNormalizerTestCase.java

@Override
@Before//from   w  w w  . jav a2 s .c om
public void setUp() throws OWLOntologyCreationException {
    super.setUp();
    IRI physicalTestBioTop = null;
    try {
        physicalTestBioTop = IRI.create(BasicImportingNormalizerTestCase.class
                .getResource(File.separatorChar + "biotoplite.owl").toURI());
    } catch (URISyntaxException e) {
        LogFactory.getLog(BasicImportingNormalizerTestCase.class).error("Could not get phyiscal BioTopURI", e);
    }
    SimpleIRIMapper bioTopMapper = new SimpleIRIMapper(biotopCanonical, physicalTestBioTop);
    manager.addIRIMapper(bioTopMapper);
    OWLOntologyLoaderConfiguration loaderConf = new OWLOntologyLoaderConfiguration();
    loaderConf = loaderConf.addIgnoredImport(biotopA);
    loaderConf = loaderConf.addIgnoredImport(biotopB);
    loaderConf = loaderConf.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);

    Map<IRI, IRI> importMap = new HashMap<IRI, IRI>();
    importMap.put(biotopA, biotopCanonical);
    importMap.put(biotopB, biotopCanonical);
    normalizer = new BasicImportingNormalizerFactory(importMap, loaderConf);
}

From source file:de.kurashigegollub.dev.gcatest.Utils.java

/**
 * Read a configuration value from the properties file
 * @param string/*from  w w  w .ja  v  a2s .c o m*/
 * @return 
 */
public static String readFromPropertiesAsString(String propertiesFile, String propertyName) throws IOException {

    InputStream is = Utils.class.getResourceAsStream(propertiesFile.replace('/', File.separatorChar));
    if (is == null) {
        throw new IOException(String.format("Could not find %s", propertiesFile));
    }

    Properties p = new Properties();
    p.load(is);

    return p.getProperty(propertyName);
}