Author: tchemit Date: 2013-04-07 12:04:46 +0200 (Sun, 07 Apr 2013) New Revision: 2576 Url: http://nuiton.org/projects/nuiton-utils/repository/revisions/2576 Log: fixes #2650: Move some FileUtil api to jaxx Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/FileUtil.java Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/FileUtil.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/FileUtil.java 2013-04-03 14:52:36 UTC (rev 2575) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/FileUtil.java 2013-04-07 10:04:46 UTC (rev 2576) @@ -23,17 +23,6 @@ * #L% */ -/* * - * FileUtil.java - * - * Created: 22 nov. 2004 - * - * @author Benjamin Poussin <poussin@codelutin.com> - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : */ - package org.nuiton.util; import org.apache.commons.io.FileUtils; @@ -83,7 +72,7 @@ * Created: 22 novembre 2004 * * @author bpoussin <poussin@codelutin.com> - * $Id$ + * @author tchemit <chemit@codelutin.com> */ public class FileUtil { // FileUtil @@ -94,16 +83,40 @@ // TODO fdesbois 2011-04-16 : Perhaps change ISO encoding by UTF-8 public static String ENCODING = "ISO-8859-1"; + /** + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + */ + @Deprecated protected static File currentDirectory = new File("."); + /** + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + */ + @Deprecated public static void setCurrentDirectory(File dir) { currentDirectory = dir; } + /** + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + */ + @Deprecated public static File getCurrentDirectory() { return currentDirectory; } + /** + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + */ + @Deprecated public static class PatternChooserFilter extends javax.swing.filechooser.FileFilter { protected String pattern; @@ -135,7 +148,11 @@ * par deux, le pattern du filtre + la description du filtre * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(String... patternOrDescriptionFilters) { File result; result = getFile(null, patternOrDescriptionFilters); @@ -148,7 +165,11 @@ * * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(javax.swing.filechooser.FileFilter... filters) { File result = getFile(null, filters); return result; @@ -163,7 +184,11 @@ * par deux, le pattern du filtre + la description du filtre * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(Component parent, String... patternOrDescriptionFilters) { File result; @@ -182,7 +207,11 @@ * par deux, le pattern du filtre + la description du filtre * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(String title, String approvalText, Component parent, @@ -213,7 +242,11 @@ * @param parent le component parent du dialog * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(Component parent, javax.swing.filechooser.FileFilter... filters) { File result = getFile("Ok", "Ok", parent, filters); @@ -229,7 +262,11 @@ * @param parent le component parent du dialog * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static File getFile(String title, String approvalText, Component parent, @@ -267,7 +304,11 @@ * @return le nom du repertoire entre dans la boite de dialogue. * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne * null. + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static String getDirectory() { return getDirectory(null, "Ok", "Ok"); } @@ -278,7 +319,11 @@ * @return le nom du repertoire entre dans la boite de dialogue. * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne * null. + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static String getDirectory(String title, String approvalText) { String result = getDirectory(null, title, approvalText); return result; @@ -291,7 +336,11 @@ * @return le nom du repertoire entre dans la boite de dialogue. * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne * null. + * @deprecated since 2.6.13, prefer use same method in + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ + @Deprecated public static String getDirectory(Component parent, String title, String approvalText) {