<commit_before>/*
 * Copyright 2012 <NAME>
 *
 * 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.
 */
import java.util.NoSuchElementException
import java.util.logging.Logger

import me.footlights.api.{Application,KernelInterface,ModifiablePreferences}

package me.footlights.apps.uploader {

/**
 * An application which uploads user-selected files into the Content-Addressed Store.
 * @author <NAME> <<EMAIL>>
 */
class Uploader(kernel:KernelInterface, prefs:ModifiablePreferences, log:Logger) extends Application
{
	def ajaxHandler = new Ajax(this)

	private[uploader] def upload() = {
		val file = kernel.openLocalFile
		file map { _.name } foreach storeName
		file
	}

	private def storedNames = prefs.getString(SAVE_LIST) map { _ split ":" toList } getOrElse Nil

	private def storeName(name:String) = prefs.synchronized {
		prefs.set(SAVE_LIST, name :: storedNames reduceLeft { _ + ":" + _ })
	}

	private val SAVE_LIST = "saved_files"
}


/** Builder used by Footlights to find and initialize the app. */
object Uploader
{
	def init(kernel:KernelInterface, prefs:ModifiablePreferences, log:Logger) =
		new Uploader(kernel, prefs, log)
}

}<commit_msg>Don't use ':' as an inter-URI separator.<commit_after>/*
 * Copyright 2012 <NAME>
 *
 * 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.
 */
import java.util.NoSuchElementException
import java.util.logging.Logger

import me.footlights.api.{Application,KernelInterface,ModifiablePreferences}

package me.footlights.apps.uploader {

/**
 * An application which uploads user-selected files into the Content-Addressed Store.
 * @author <NAME> <<EMAIL>>
 */
class Uploader(kernel:KernelInterface, prefs:ModifiablePreferences, log:Logger) extends Application
{
	def ajaxHandler = new Ajax(this)

	private[uploader] def upload() = {
		val file = kernel.openLocalFile
		file map { _.name } foreach storeName
		file
	}

	private[uploader] def storedNames =
			prefs.getString(SAVE_LIST) map { _ split ";" toList } getOrElse Nil

	private def storeName(name:String) = prefs.synchronized {
		prefs.set(SAVE_LIST, name :: storedNames reduceLeft { _ + ";" + _ })
	}

	private val SAVE_LIST = "saved_files"
}


/** Builder used by Footlights to find and initialize the app. */
object Uploader
{
	def init(kernel:KernelInterface, prefs:ModifiablePreferences, log:Logger) =
		new Uploader(kernel, prefs, log)
}

}
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 4.438511326860842, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3231454', 'n_tokens_mistral': 999, 'n_tokens_neox': 955, 'n_words': 337}