public static String createTrackfile(final Activity activity, final Uri uri) {
        // copy file to c:geo internal storage
        final String fn = FileNameCreator.TRACKFILE.createName();
        final Uri targetUri = Uri.fromFile(new File(LocalStorage.getTrackfilesDir(), fn));
        try {
            IOUtils.copy(
                    activity.getContentResolver().openInputStream(uri),
                    activity.getContentResolver().openOutputStream(targetUri));
        } catch (IOException ioe) {
            Log.e("Problem copying trackfile from '" + uri.getLastPathSegment() + "' to '" + targetUri + "'", ioe);
        }
        // add entry to list of trackfiles
        removeAll(type, fn);
        add(type, fn, 0, 0, 0, 0, ContentStorage.get().getName(uri), "", "", "");
        return fn;
    }
to be called by Tracks only, not intended for direct usage
main/src/main/java/cgeo/geocaching/storage/extension/Trackfiles.java