diff --git a/.classpath b/.classpath index da2422f..1ef42dc 100644 --- a/.classpath +++ b/.classpath @@ -3,22 +3,16 @@ - - - - - - - - - - - + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 7ced310..cef5ca2 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index d0e0b2d..b84ac01 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -2,6 +2,6 @@ - + diff --git a/lib/Logs/slf4j-api-1.7.25-sources.jar b/lib/Logs/slf4j-api-1.7.25-sources.jar new file mode 100644 index 0000000..b2a3d83 Binary files /dev/null and b/lib/Logs/slf4j-api-1.7.25-sources.jar differ diff --git a/lib/Logs/slf4j-api-1.7.25.jar b/lib/Logs/slf4j-api-1.7.25.jar new file mode 100644 index 0000000..7e62f13 Binary files /dev/null and b/lib/Logs/slf4j-api-1.7.25.jar differ diff --git a/lib/Logs/slf4j-api-1.7.5-sources.jar b/lib/Logs/slf4j-api-1.7.5-sources.jar deleted file mode 100644 index 51abe2b..0000000 Binary files a/lib/Logs/slf4j-api-1.7.5-sources.jar and /dev/null differ diff --git a/lib/Logs/slf4j-api-1.7.5.jar b/lib/Logs/slf4j-api-1.7.5.jar deleted file mode 100644 index 8766455..0000000 Binary files a/lib/Logs/slf4j-api-1.7.5.jar and /dev/null differ diff --git a/lib/Logs/slf4j-log4j12-1.7.25-sources.jar b/lib/Logs/slf4j-log4j12-1.7.25-sources.jar new file mode 100644 index 0000000..0cd5be7 Binary files /dev/null and b/lib/Logs/slf4j-log4j12-1.7.25-sources.jar differ diff --git a/lib/Logs/slf4j-log4j12-1.7.25.jar b/lib/Logs/slf4j-log4j12-1.7.25.jar new file mode 100644 index 0000000..4a44e06 Binary files /dev/null and b/lib/Logs/slf4j-log4j12-1.7.25.jar differ diff --git a/lib/Logs/slf4j-log4j12-1.7.5-sources.jar b/lib/Logs/slf4j-log4j12-1.7.5-sources.jar deleted file mode 100644 index ea1b93b..0000000 Binary files a/lib/Logs/slf4j-log4j12-1.7.5-sources.jar and /dev/null differ diff --git a/lib/Logs/slf4j-log4j12-1.7.5.jar b/lib/Logs/slf4j-log4j12-1.7.5.jar deleted file mode 100644 index afce5c2..0000000 Binary files a/lib/Logs/slf4j-log4j12-1.7.5.jar and /dev/null differ diff --git a/lib/UnitTesting/junit-4.11-sources.jar b/lib/UnitTesting/junit-4.11-sources.jar deleted file mode 100644 index bab4cdd..0000000 Binary files a/lib/UnitTesting/junit-4.11-sources.jar and /dev/null differ diff --git a/lib/UnitTesting/junit-4.11.jar b/lib/UnitTesting/junit-4.11.jar deleted file mode 100644 index aaf7444..0000000 Binary files a/lib/UnitTesting/junit-4.11.jar and /dev/null differ diff --git a/lib/UnitTesting/junit-4.12-sources.jar b/lib/UnitTesting/junit-4.12-sources.jar new file mode 100644 index 0000000..884f92f Binary files /dev/null and b/lib/UnitTesting/junit-4.12-sources.jar differ diff --git a/lib/UnitTesting/junit-4.12.jar b/lib/UnitTesting/junit-4.12.jar new file mode 100644 index 0000000..3a7fc26 Binary files /dev/null and b/lib/UnitTesting/junit-4.12.jar differ diff --git a/lib/commons-lang3-3.1-sources.jar b/lib/commons-lang3-3.1-sources.jar deleted file mode 100644 index 02cd2f2..0000000 Binary files a/lib/commons-lang3-3.1-sources.jar and /dev/null differ diff --git a/lib/commons-lang3-3.1.jar b/lib/commons-lang3-3.1.jar deleted file mode 100644 index a85e539..0000000 Binary files a/lib/commons-lang3-3.1.jar and /dev/null differ diff --git a/lib/commons-lang3-3.7-sources.jar b/lib/commons-lang3-3.7-sources.jar new file mode 100644 index 0000000..a83c661 Binary files /dev/null and b/lib/commons-lang3-3.7-sources.jar differ diff --git a/lib/commons-lang3-3.7.jar b/lib/commons-lang3-3.7.jar new file mode 100644 index 0000000..f37ded6 Binary files /dev/null and b/lib/commons-lang3-3.7.jar differ diff --git a/lib/devinsy-cmdexec-0.4.0-sources.zip b/lib/devinsy-cmdexec-0.4.0-sources.zip deleted file mode 100644 index 1f65023..0000000 Binary files a/lib/devinsy-cmdexec-0.4.0-sources.zip and /dev/null differ diff --git a/lib/devinsy-cmdexec-0.4.0.jar b/lib/devinsy-cmdexec-0.4.0.jar deleted file mode 100644 index a76fa4c..0000000 Binary files a/lib/devinsy-cmdexec-0.4.0.jar and /dev/null differ diff --git a/lib/devinsy-rss-0.4.0-sources.zip b/lib/devinsy-rss-0.4.0-sources.zip deleted file mode 100644 index ffa5ba7..0000000 Binary files a/lib/devinsy-rss-0.4.0-sources.zip and /dev/null differ diff --git a/lib/devinsy-rss-0.4.0.jar b/lib/devinsy-rss-0.4.0.jar deleted file mode 100644 index 7e78196..0000000 Binary files a/lib/devinsy-rss-0.4.0.jar and /dev/null differ diff --git a/lib/devinsy-strings-0.4.0-sources.zip b/lib/devinsy-strings-0.4.0-sources.zip deleted file mode 100644 index 0ec9078..0000000 Binary files a/lib/devinsy-strings-0.4.0-sources.zip and /dev/null differ diff --git a/lib/devinsy-strings-0.4.0.jar b/lib/devinsy-strings-0.4.0.jar deleted file mode 100644 index 96018e1..0000000 Binary files a/lib/devinsy-strings-0.4.0.jar and /dev/null differ diff --git a/lib/devinsy-unix-0.4.0-sources.zip b/lib/devinsy-unix-0.4.0-sources.zip deleted file mode 100644 index e041cb7..0000000 Binary files a/lib/devinsy-unix-0.4.0-sources.zip and /dev/null differ diff --git a/lib/devinsy-unix-0.4.0.jar b/lib/devinsy-unix-0.4.0.jar deleted file mode 100644 index 5278dce..0000000 Binary files a/lib/devinsy-unix-0.4.0.jar and /dev/null differ diff --git a/lib/devinsy-xml-0.4.0-sources.zip b/lib/devinsy-xml-0.4.0-sources.zip deleted file mode 100644 index 63329bb..0000000 Binary files a/lib/devinsy-xml-0.4.0-sources.zip and /dev/null differ diff --git a/lib/devinsy-xml-0.4.0.jar b/lib/devinsy-xml-0.4.0.jar deleted file mode 100644 index 17661ce..0000000 Binary files a/lib/devinsy-xml-0.4.0.jar and /dev/null differ diff --git a/lib/joda-time-2.3-sources.jar b/lib/joda-time-2.3-sources.jar deleted file mode 100644 index a2dda2e..0000000 Binary files a/lib/joda-time-2.3-sources.jar and /dev/null differ diff --git a/lib/joda-time-2.3.jar b/lib/joda-time-2.3.jar deleted file mode 100644 index 9dce4f9..0000000 Binary files a/lib/joda-time-2.3.jar and /dev/null differ diff --git a/src/fr/devinsy/util/FileTools.java b/src/fr/devinsy/util/FileTools.java index 105ce81..f9252fe 100644 --- a/src/fr/devinsy/util/FileTools.java +++ b/src/fr/devinsy/util/FileTools.java @@ -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 - * org.apache.commons.io.FilenameUtils.getExtension + * @deprecated See org.apache.commons.io.FilenameUtils.getExtension */ @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. * diff --git a/src/fr/devinsy/util/ToolBox.java b/src/fr/devinsy/util/ToolBox.java index 071e527..640f41c 100644 --- a/src/fr/devinsy/util/ToolBox.java +++ b/src/fr/devinsy/util/ToolBox.java @@ -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. * diff --git a/test/TestTree/P b/test/TestTree/P new file mode 120000 index 0000000..08d49f3 --- /dev/null +++ b/test/TestTree/P @@ -0,0 +1 @@ +20081111-nouvelle_voiture \ No newline at end of file diff --git a/test/TestTree/P/dsc01469.jpg b/test/TestTree/P/dsc01469.jpg deleted file mode 100755 index 49b1665..0000000 Binary files a/test/TestTree/P/dsc01469.jpg and /dev/null differ diff --git a/test/TestTree/P/dsc01470.jpg b/test/TestTree/P/dsc01470.jpg deleted file mode 100755 index 88a4027..0000000 Binary files a/test/TestTree/P/dsc01470.jpg and /dev/null differ diff --git a/test/TestTree/P/dsc01472.jpg b/test/TestTree/P/dsc01472.jpg deleted file mode 100755 index 8fff0e5..0000000 Binary files a/test/TestTree/P/dsc01472.jpg and /dev/null differ diff --git a/test/TestTree/P/dsc01474.jpg b/test/TestTree/P/dsc01474.jpg deleted file mode 100755 index 0e662f1..0000000 Binary files a/test/TestTree/P/dsc01474.jpg and /dev/null differ diff --git a/test/TestTree/xine.jpg b/test/TestTree/xine.jpg deleted file mode 100644 index a89443b..0000000 Binary files a/test/TestTree/xine.jpg and /dev/null differ diff --git a/test/TestTree/xine.jpg b/test/TestTree/xine.jpg new file mode 120000 index 0000000..45bdf0a --- /dev/null +++ b/test/TestTree/xine.jpg @@ -0,0 +1 @@ +xine_snapshot-4.jpg \ No newline at end of file diff --git a/test/fr/devinsy/util/FileToolsTest.java b/test/fr/devinsy/util/FileToolsTest.java index e9c52e6..4df09c1 100644 --- a/test/fr/devinsy/util/FileToolsTest.java +++ b/test/fr/devinsy/util/FileToolsTest.java @@ -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. */