<commit_before>package peergos.shared.user.fs;
import java.util.logging.*;

import jsinterop.annotations.*;
import peergos.shared.*;
import peergos.shared.crypto.*;
import peergos.shared.crypto.asymmetric.*;
import peergos.shared.crypto.random.*;
import peergos.shared.crypto.symmetric.*;
import peergos.shared.io.ipfs.multihash.*;
import peergos.shared.user.*;
import peergos.shared.user.fs.cryptree.*;
import peergos.shared.util.*;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.Graphics2D;
import java.awt.AlphaComposite;
import java.awt.RenderingHints;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.time.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.function.*;
import java.util.stream.*;

/** This class is used to read and modify files and directories and represents a single file or directory
 *
 */
public class FileWrapper {
	private static final Logger LOG = Logger.getGlobal();

    final static int THUMBNAIL_SIZE = 100;
    private final NativeJSThumbnail thumbnail;
    private final RetrievedCapability pointer;
    private final FileProperties props;
    private final String ownername;
    private final Optional<TrieNode> globalRoot;
    private final Optional<SecretSigningKey> entryWriterKey;
    private AtomicBoolean modified = new AtomicBoolean(); // This only used as a guard against concurrent modifications

    /**
     *
     * @param globalRoot This is only present if this is the global root
     * @param pointer
     * @param ownername
     * @param entryWriterKey
     */
    public FileWrapper(Optional<TrieNode> globalRoot, RetrievedCapability pointer, String ownername,
                       Optional<SecretSigningKey> entryWriterKey) {
        this.globalRoot = globalRoot;
        this.pointer = pointer == null ? null : pointer.withWriter(entryWriterKey);
        this.ownername = ownername;
        this.entryWriterKey = entryWriterKey;
        if (pointer == null)
            props = new FileProperties("/", "", 0, LocalDateTime.MIN, false, Optional.empty());
        else {
            SymmetricKey parentKey = this.getParentKey();
            props = pointer.fileAccess.getProperties(parentKey);
        }
        thumbnail = new NativeJSThumbnail();
    }<commit_msg>Make instance var static (NativeJSThumbnail)<commit_after>package peergos.shared.user.fs;
import java.util.logging.*;

import jsinterop.annotations.*;
import peergos.shared.*;
import peergos.shared.crypto.*;
import peergos.shared.crypto.asymmetric.*;
import peergos.shared.crypto.random.*;
import peergos.shared.crypto.symmetric.*;
import peergos.shared.io.ipfs.multihash.*;
import peergos.shared.user.*;
import peergos.shared.user.fs.cryptree.*;
import peergos.shared.util.*;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.awt.Graphics2D;
import java.awt.AlphaComposite;
import java.awt.RenderingHints;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.time.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.function.*;
import java.util.stream.*;

/** This class is used to read and modify files and directories and represents a single file or directory
 *
 */
public class FileWrapper {
	private static final Logger LOG = Logger.getGlobal();

    private final static int THUMBNAIL_SIZE = 100;
    private static final NativeJSThumbnail thumbnail = new NativeJSThumbnail();

    private final RetrievedCapability pointer;
    private final FileProperties props;
    private final String ownername;
    private final Optional<TrieNode> globalRoot;
    private final Optional<SecretSigningKey> entryWriterKey;
    private AtomicBoolean modified = new AtomicBoolean(); // This only used as a guard against concurrent modifications

    /**
     *
     * @param globalRoot This is only present if this is the global root
     * @param pointer
     * @param ownername
     * @param entryWriterKey
     */
    public FileWrapper(Optional<TrieNode> globalRoot, RetrievedCapability pointer, String ownername,
                       Optional<SecretSigningKey> entryWriterKey) {
        this.globalRoot = globalRoot;
        this.pointer = pointer == null ? null : pointer.withWriter(entryWriterKey);
        this.ownername = ownername;
        this.entryWriterKey = entryWriterKey;
        if (pointer == null)
            props = new FileProperties("/", "", 0, LocalDateTime.MIN, false, Optional.empty());
        else {
            SymmetricKey parentKey = this.getParentKey();
            props = pointer.fileAccess.getProperties(parentKey);
        }
    }
{'fraction_non_alphanumeric': 0.09978991596638656, 'fraction_numerical': 0.0021008403361344537, 'mean_word_length': 3.6722276741903825, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '123018', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1281, 'n_words': 363}