<commit_before>package io.liveoak.filesystem;

import io.liveoak.spi.RequestContext;
import io.liveoak.spi.resource.RootResource;
import io.liveoak.spi.resource.SynchronousResource;
import io.liveoak.spi.resource.async.Resource;
import io.liveoak.spi.resource.async.Responder;
import io.liveoak.spi.state.ResourceState;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * @author <NAME>
 */
public class FileSystemAdminResource implements RootResource, SynchronousResource {

    public FileSystemAdminResource(String id, File directory) {
        this.id = id;
        this.directory = directory;
    }

    @Override
    public void parent(Resource parent) {
        this.parent = parent;
    }

    @Override
    public Resource parent() {
        return this.parent;
    }

    @Override
    public String id() {
        return this.id;
    }

    @Override
    public Map<String, ?> properties(RequestContext ctx) throws Exception {
        Map<String, String> result = new HashMap<>();
        result.put("directory", this.directory.getAbsolutePath());
        return result;
    }

    @Override
    public void updateProperties(RequestContext ctx, ResourceState state, Responder responder) throws Exception {
        String directory = (String) state.getProperty("directory");<commit_msg>Modify FileSystemAdminResource to use override initializeProperties() and call updateProperties() so they have the same handling<commit_after>package io.liveoak.filesystem;

import io.liveoak.spi.RequestContext;
import io.liveoak.spi.resource.RootResource;
import io.liveoak.spi.resource.SynchronousResource;
import io.liveoak.spi.resource.async.Resource;
import io.liveoak.spi.resource.async.Responder;
import io.liveoak.spi.state.ResourceState;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * @author <NAME>
 */
public class FileSystemAdminResource implements RootResource, SynchronousResource {

    public FileSystemAdminResource(String id, File directory) {
        this.id = id;
        this.directory = directory;
    }

    @Override
    public void parent(Resource parent) {
        this.parent = parent;
    }

    @Override
    public Resource parent() {
        return this.parent;
    }

    @Override
    public String id() {
        return this.id;
    }

    @Override
    public Map<String, ?> properties(RequestContext ctx) throws Exception {
        Map<String, String> result = new HashMap<>();
        result.put("directory", this.directory.getAbsolutePath());
        return result;
    }

    @Override
    public void initializeProperties(RequestContext ctx, ResourceState state, Responder responder) throws Exception {
        updateProperties(ctx, state, responder);
    }

    @Override
    public void updateProperties(RequestContext ctx, ResourceState state, Responder responder) throws Exception {
        String directory = (String) state.getProperty("directory");
{'fraction_non_alphanumeric': 0.09704784526637258, 'fraction_numerical': 0.0, 'mean_word_length': 3.549382716049383, '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': '7063194', 'n_tokens_mistral': 813, 'n_tokens_neox': 798, 'n_words': 201}