<commit_before>package net.nitroshare.android.bundle;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * An individual file for transfer
 *
 * Note that Android's Java doesn't include java.nio.file so only the
 * last_modified property is usable on the platform.
 */
public class FileItem extends Item {

    // Additional properties for files
    private static final String READ_ONLY = "read_only";
    private static final String EXECUTABLE = "executable";
    private static final String LAST_MODIFIED = "last_modified";

    private File mFile;
    private Map<String, Object> mProperties;

    /**
     * Create a new file item from the specified path and filename
     * @param path absolute path
     * @param filename filename relative to path
     */
    public FileItem(String path, String filename) {
        mFile = new File(new File(path), filename);
        mProperties = new HashMap<>();
        mProperties.put(TYPE, "file");
        mProperties.put(NAME, filename);
        mProperties.put(SIZE, Long.toString(mFile.length()));
        mProperties.put(READ_ONLY, !mFile.canWrite());
        mProperties.put(EXECUTABLE, mFile.canExecute());
        mProperties.put(LAST_MODIFIED, mFile.lastModified());
    }

    @Override
    public Map<String, Object> getProperties() {
        return mProperties;
    }

    private FileInputStream mInputStream;
    private FileOutputStream mOutputStream;

    @Override
    public void open(Mode mode) throws IOException {
        switch (mode) {
            case Read:
                mInputStream = new FileInputStream(mFile);
            case Write:
                mOutputStream = new FileOutputStream(mFile);
        }<commit_msg>Add missing 'break' statements and ensure last modification timestamp is passed as a string.<commit_after>package net.nitroshare.android.bundle;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * An individual file for transfer
 *
 * Note that Android's Java doesn't include java.nio.file so only the
 * last_modified property is usable on the platform.
 */
public class FileItem extends Item {

    // Additional properties for files
    private static final String READ_ONLY = "read_only";
    private static final String EXECUTABLE = "executable";
    private static final String LAST_MODIFIED = "last_modified";

    private File mFile;
    private Map<String, Object> mProperties;

    /**
     * Create a new file item from the specified path and filename
     * @param path absolute path
     * @param filename filename relative to path
     */
    public FileItem(String path, String filename) {
        mFile = new File(new File(path), filename);
        mProperties = new HashMap<>();
        mProperties.put(TYPE, "file");
        mProperties.put(NAME, filename);
        mProperties.put(SIZE, Long.toString(mFile.length()));
        mProperties.put(READ_ONLY, !mFile.canWrite());
        mProperties.put(EXECUTABLE, mFile.canExecute());
        mProperties.put(LAST_MODIFIED, Long.toString(mFile.lastModified()));
    }

    @Override
    public Map<String, Object> getProperties() {
        return mProperties;
    }

    private FileInputStream mInputStream;
    private FileOutputStream mOutputStream;

    @Override
    public void open(Mode mode) throws IOException {
        switch (mode) {
            case Read:
                mInputStream = new FileInputStream(mFile);
                break;
            case Write:
                mOutputStream = new FileOutputStream(mFile);
                break;
        }
{'fraction_non_alphanumeric': 0.08931419457735247, 'fraction_numerical': 0.0, 'mean_word_length': 2.9610526315789474, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '372781', 'n_tokens_mistral': 992, 'n_tokens_neox': 968, 'n_words': 311}