Example usage for java.io File separator

List of usage examples for java.io File separator

Introduction

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

Prototype

String separator

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

Click Source Link

Document

The system-dependent default name-separator character, represented as a string for convenience.

Usage

From source file:ca.weblite.xmlvm.XmlvmHelper.java

public static void runXmlvm(Project project, Path xmlvmClasspath, String[] args) {
    Path path = new Path(project, System.getProperty("java.class.path"));
    if (xmlvmClasspath != null) {
        path.add(xmlvmClasspath);/*from  www . j av  a  2  s  . c  o m*/
    }
    System.out.println("Checking classpath for xmlvm.jar: " + path);
    String xmlvm = null;
    for (String p : path.list()) {
        if (p.equals("xmlvm.jar") || p.endsWith(File.separator + "xmlvm.jar")) {
            xmlvm = p;
        }
    }
    if (xmlvm == null) {
        throw new RuntimeException("Could not find XMLVM ");

    }
    runXmlvm(project, args, new File(xmlvm));

}

From source file:Main.java

public static String getPendingDeletionTablesFolder(String appName) {
    String path = getSystemFolder(appName) + File.separator + STALE_TABLES_FOLDER_NAME;
    return path;/*w w  w .j  a  va 2 s . co  m*/
}

From source file:Main.java

/**
 * Convert a relative path into an application filename
 *
 * @param appName// w w w.  jav  a2 s .  c  om
 * @param relativePath
 * @return
 */
public static File asAppFile(String appName, String relativePath) {
    return new File(getAppFolder(appName) + File.separator + relativePath);
}

From source file:Main.java

public static String getPendingInsertionTablesFolder(String appName) {
    String path = getSystemFolder(appName) + File.separator + PENDING_TABLES_FOLDER_NAME;
    return path;//from   w w  w  .j a v  a 2  s.  c o  m
}

From source file:Main.java

public static File getDiskCacheDir(Context context, String uniqueName) {
    final String cachePath = Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
            ? getExternalCacheDir(context).getPath()
            : context.getCacheDir().getPath();

    return new File(cachePath + File.separator + uniqueName);
}

From source file:Main.java

public static String getARPSpoofBinaryPath(Context c) {
    return c.getFilesDir().getAbsolutePath() + File.separator + "arpspoof";
}

From source file:Main.java

/**
 * create a new filename based on the current time
 * @return// w ww  .  j  av  a 2 s .  co  m
 */
@SuppressLint("SimpleDateFormat")
public static String createFileName() {
    File pictureFileDir = getAppDir();

    // display and log an error when a directory cant be found or created
    if (!pictureFileDir.exists() && !pictureFileDir.mkdirs()) {
        Log.d(TAG, "Can't create directory to save image.");
        return "";
    }

    // create a name for the picture based on the current date
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US);
    String date = dateFormat.format(new Date());
    String photoFile = "Picture_" + date + ".jpg";

    String fileName = pictureFileDir.getPath() + File.separator + photoFile;

    return fileName;
}

From source file:com.sm.localstore.TestLocalStore.java

public static String[] checkPath(String filename) {
    String path = "./";
    String name;//from  w w  w . j  a  v  a 2 s  .  co  m
    int sep = filename.lastIndexOf(File.separator);
    if (sep >= 0) {
        path = filename.substring(0, sep + 1);
        name = filename.substring(sep + 1, filename.length());

    } else {
        int slash = filename.lastIndexOf("/");
        // no file seperator
        if (slash >= 0) {
            path = filename.substring(0, slash + 1);
            name = filename.substring(slash + 1, filename.length());
        } else
            name = filename;
    }
    //String[] toReturn = new String[]
    return new String[] { path, name };
}

From source file:Main.java

public static String getFormsFolder(String appName, String tableId) {
    String path = getTablesFolder(appName, tableId) + File.separator + FORMS_FOLDER_NAME;
    return path;/* ww w . j  a  v  a  2  s  . c  om*/
}

From source file:Main.java

public static String getDroidSheepBinaryPath(Context c) {
    return c.getFilesDir().getAbsolutePath() + File.separator + "droidsheep";
}