Removed code extracted in outside projects. Upgraded library jars.

This commit is contained in:
Christian P. MOMON 2018-05-31 15:47:43 +02:00
parent c985fc2cdd
commit 27246462b2
40 changed files with 14 additions and 278 deletions

View file

@ -3,22 +3,16 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.1.jar" sourcepath="lib/commons-lang3-3.1-sources.jar"/>
<classpathentry kind="lib" path="lib/joda-time-2.3.jar" sourcepath="lib/joda-time-2.3-sources.jar"/>
<classpathentry kind="lib" path="lib/devinsy-strings-0.4.0.jar" sourcepath="lib/devinsy-strings-0.4.0-sources.zip"/>
<classpathentry kind="lib" path="lib/Logs/log4j-1.2.17.jar" sourcepath="lib/Logs/log4j-1.2.17-source.zip"/>
<classpathentry kind="lib" path="lib/Logs/slf4j-api-1.7.5.jar" sourcepath="lib/Logs/slf4j-api-1.7.5-sources.jar"/>
<classpathentry kind="lib" path="lib/Logs/slf4j-log4j12-1.7.5.jar" sourcepath="lib/Logs/slf4j-log4j12-1.7.5-sources.jar"/>
<classpathentry kind="lib" path="lib/UnitTesting/hamcrest-core-1.3.jar" sourcepath="lib/UnitTesting/hamcrest-core-1.3-sources.jar"/>
<classpathentry kind="lib" path="lib/UnitTesting/junit-4.11.jar" sourcepath="lib/UnitTesting/junit-4.11-sources.jar"/>
<classpathentry kind="lib" path="lib/devinsy-rss-0.4.0.jar" sourcepath="lib/devinsy-rss-0.4.0-sources.zip"/>
<classpathentry kind="lib" path="lib/devinsy-xml-0.4.0.jar" sourcepath="lib/devinsy-xml-0.4.0-sources.zip"/>
<classpathentry kind="lib" path="lib/devinsy-cmdexec-0.4.0.jar" sourcepath="lib/devinsy-cmdexec-0.4.0-sources.zip"/>
<classpathentry kind="lib" path="lib/devinsy-unix-0.4.0.jar" sourcepath="lib/devinsy-unix-0.4.0-sources.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/Logs/slf4j-api-1.7.25.jar" sourcepath="lib/Logs/slf4j-api-1.7.25-sources.jar"/>
<classpathentry kind="lib" path="lib/Logs/slf4j-log4j12-1.7.25.jar" sourcepath="lib/Logs/slf4j-log4j12-1.7.25-sources.jar"/>
<classpathentry kind="lib" path="lib/UnitTesting/junit-4.12.jar" sourcepath="lib/UnitTesting/junit-4.12-sources.jar"/>
<classpathentry kind="lib" path="lib/commons-lang3-3.7.jar" sourcepath="lib/commons-lang3-3.7-sources.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,14 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -2,6 +2,6 @@
<faceted-project>
<fixed facet="jst.java"/>
<fixed facet="jst.utility"/>
<installed facet="jst.java" version="6.0"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="jst.java" version="1.8"/>
</faceted-project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/commons-lang3-3.7.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2015,2017 Christian Pierre MOMON
* Copyright (C) 2008-2015,2017-2018 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
*
@ -31,9 +31,6 @@ import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import fr.devinsy.util.strings.StringList;
import fr.devinsy.util.strings.StringListUtils;
/**
* The Class FileTools.
*
@ -155,8 +152,7 @@ public class FileTools
* @param fileName
* the file name
* @return Extension value or null.
* @deprecated See
* <code>org.apache.commons.io.FilenameUtils.getExtension</code>
* @deprecated See <code>org.apache.commons.io.FilenameUtils.getExtension</code>
*/
@Deprecated
public static String getExtension(final String fileName)
@ -269,46 +265,6 @@ public class FileTools
return result;
}
/**
* Load string list.
*
* @param source
* the source
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadStringList(final File source) throws IOException
{
StringList result;
result = loadStringList(source, DEFAULT_CHARSET_NAME);
//
return result;
}
/**
* Load string list.
*
* @param file
* the file
* @param charsetName
* the charset name
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadStringList(final File file, final String charsetName) throws IOException
{
StringList result;
result = StringListUtils.load(file, charsetName);
//
return result;
}
/**
* Load to string buffer.
*
@ -384,122 +340,6 @@ public class FileTools
return result;
}
/**
* Load to string list.
*
* @param source
* the source
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadToStringList(final File source) throws IOException
{
StringList result;
result = loadToStringList(source, DEFAULT_CHARSET_NAME);
//
return result;
}
/**
* Load to string list.
*
* @param file
* the file
* @param charsetName
* the charset name
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadToStringList(final File file, final String charsetName) throws IOException
{
StringList result;
BufferedReader in = null;
try
{
in = new BufferedReader(new InputStreamReader(new FileInputStream(file), charsetName));
boolean ended = false;
final String LINE_SEPARATOR = System.getProperty("line.separator");
result = new StringList();
while (!ended)
{
String line = in.readLine();
if (line == null)
{
ended = true;
}
else
{
result.append(line).append(LINE_SEPARATOR);
}
}
}
finally
{
try
{
if (in != null)
{
in.close();
}
}
catch (IOException exception)
{
exception.printStackTrace();
}
}
//
return result;
}
/**
* Load to string list.
*
* @param source
* the source
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadToStringList(final URL source) throws IOException
{
StringList result;
result = loadToStringList(source, DEFAULT_CHARSET_NAME);
//
return result;
}
/**
* Load to string list.
*
* @param source
* the source
* @param charsetName
* the charset name
* @return the string list
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static StringList loadToStringList(final URL source, final String charsetName) throws IOException
{
StringList result;
//
result = StringListUtils.load(source, charsetName);
//
return result;
}
/**
* Read.
*
@ -636,23 +476,6 @@ public class FileTools
save(file, source.toString());
}
/**
* Save.
*
* @param file
* the file
* @param source
* the source
* @throws UnsupportedEncodingException
* the unsupported encoding exception
* @throws FileNotFoundException
* the file not found exception
*/
public static void save(final File file, final StringList source) throws UnsupportedEncodingException, FileNotFoundException
{
StringListUtils.save(file, source);
}
/**
* Sets the extension.
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2010,2013-2014,2017 Christian Pierre MOMON
* Copyright (C) 2008-2010,2013-2014,2017-2018 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
*
@ -24,8 +24,6 @@ import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import fr.devinsy.util.strings.StringList;
/**
* The Class ToolBox.
*
@ -257,60 +255,6 @@ public class ToolBox
return result;
}
/**
* Concatenates int values from an array, adding decoration strings.
*
* @param values
* Source of int values.
* @param prefix
* Decoration to put on start.
* @param separator
* Decoration to put between values.
* @param postfix
* Decoration to put on end.
*
* @return A decorated string representing the int values.
*/
public static String toString(final int[] values, final String prefix, final String separator, final String postfix)
{
String result;
StringList buffer = new StringList();
//
if (prefix != null)
{
buffer.append(prefix);
}
//
boolean firstPassed = false;
for (int value : values)
{
if (firstPassed)
{
buffer.append(separator);
}
else
{
firstPassed = true;
}
buffer.append(value);
}
//
if (postfix != null)
{
buffer.append(postfix);
}
//
result = buffer.toString();
//
return result;
}
/**
* To string.
*

1
test/TestTree/P Symbolic link
View file

@ -0,0 +1 @@
20081111-nouvelle_voiture

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 869 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 19 B

1
test/TestTree/xine.jpg Symbolic link
View file

@ -0,0 +1 @@
xine_snapshot-4.jpg

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 19 B

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2014,2017 Christian Pierre MOMON
* Copyright (C) 2014,2017-2018 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
*
@ -18,8 +18,6 @@
*/
package fr.devinsy.util;
import java.io.IOException;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@ -27,8 +25,6 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import fr.devinsy.util.strings.StringList;
/**
* The Class FileToolsTest.
*
@ -49,28 +45,6 @@ public class FileToolsTest
Logger.getRootLogger().setLevel(Level.ERROR);
}
/**
* Load to string list URL 01.
*
* @throws IOException
* Signals that an I/O exception has occurred.
*/
@Test
public void loadToStringListURL01() throws IOException
{
//
this.logger.debug("===== test starting...");
//
StringList source = FileTools.loadToStringList(FileTools.class.getResource("/fr/devinsy/util/lines.txt"));
//
Assert.assertEquals(4, source.size());
Assert.assertEquals("trois", source.get(3 - 1));
//
this.logger.debug("===== test done.");
}
/**
* Test get extension.
*/