<commit_before>/*
 * Copyright 2011 Red Hat inc. and third party contributors as noted 
 * by the author tags.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.redhat.ceylon.cmr.impl;

import java.util.HashSet;
import java.util.Set;

import com.redhat.ceylon.cmr.api.Logger;
import com.redhat.ceylon.cmr.spi.ContentStore;
import com.redhat.ceylon.cmr.spi.Node;
import com.redhat.ceylon.cmr.spi.StructureBuilder;

/**
 * Abstract content store.
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public abstract class AbstractContentStore implements ContentStore, StructureBuilder {

    private static final String CAR = ".car";
    private static final String JAR = ".jar";
    private static final String PROPERTIES = ".properties";
    private static final String SHA1 = ".sha1";
    private static final String SRC = ".src";
    private static final String XML = ".xml";
    private static final String ZIP = ".zip";

    protected static final String SEPARATOR = "/";

    protected final Set<String> suffixes = new HashSet<String>();
    protected boolean offline;
    protected Logger log;

    protected AbstractContentStore(Logger log, boolean offline) {
        this.log = log;
        this.offline = offline;
        addSuffix(CAR);
        addSuffix(JAR);
        addSuffix(PROPERTIES);<commit_msg>AbstractContentStore: fix for #60: null stream error for js resolved from remote content stores<commit_after>/*
 * Copyright 2011 Red Hat inc. and third party contributors as noted 
 * by the author tags.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.redhat.ceylon.cmr.impl;

import java.util.HashSet;
import java.util.Set;

import com.redhat.ceylon.cmr.api.Logger;
import com.redhat.ceylon.cmr.spi.ContentStore;
import com.redhat.ceylon.cmr.spi.Node;
import com.redhat.ceylon.cmr.spi.StructureBuilder;

/**
 * Abstract content store.
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public abstract class AbstractContentStore implements ContentStore, StructureBuilder {

    private static final String CAR = ".car";
    private static final String JAR = ".jar";
    private static final String JS = ".js";
    private static final String PROPERTIES = ".properties";
    private static final String SHA1 = ".sha1";
    private static final String SRC = ".src";
    private static final String XML = ".xml";
    private static final String ZIP = ".zip";

    protected static final String SEPARATOR = "/";

    protected final Set<String> suffixes = new HashSet<String>();
    protected boolean offline;
    protected Logger log;

    protected AbstractContentStore(Logger log, boolean offline) {
        this.log = log;
        this.offline = offline;
        addSuffix(CAR);
        addSuffix(JAR);
        addSuffix(JS);
        addSuffix(PROPERTIES);
{'fraction_non_alphanumeric': 0.09447788537032191, 'fraction_numerical': 0.0057576550641193405, 'mean_word_length': 3.5663082437275984, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '6542543', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1029, 'n_words': 403}