001package org.unix4j.unix.ls;
002
003import org.unix4j.unix.Ls;
004
005/**
006 * Factory for the {@link Ls ls} command returning 
007 * a new command instance from every signature method.
008 */
009public final class LsFactory implements Ls.Interface<LsCommand> {
010        
011        /**
012         * The singleton instance of this factory.
013         */
014        public static final LsFactory INSTANCE = new LsFactory();
015
016        /**
017         * Private, only used to create singleton instance.
018         */
019        private LsFactory() {
020                super();
021        }
022
023        @Override
024        public LsCommand ls() {
025                final LsArguments lsArgs = new LsArguments();
026                return new LsCommand(lsArgs);
027        }
028
029        @Override
030        public LsCommand ls(String... args) {
031                final LsArguments lsArgs = new LsArguments(args);
032                return new LsCommand(lsArgs);
033        }
034
035        @Override
036        public LsCommand ls(java.io.File... files) {
037                final LsArguments lsArgs = new LsArguments();
038                lsArgs.setFiles(files);
039                return new LsCommand(lsArgs);
040        }
041
042        @Override
043        public LsCommand ls(LsOptions options) {
044                final LsArguments lsArgs = new LsArguments(options);
045                return new LsCommand(lsArgs);
046        }
047
048        @Override
049        public LsCommand ls(LsOptions options, java.io.File... files) {
050                final LsArguments lsArgs = new LsArguments(options);
051                lsArgs.setFiles(files);
052                return new LsCommand(lsArgs);
053        }
054
055        @Override
056        public LsCommand ls(LsOptions options, String... paths) {
057                final LsArguments lsArgs = new LsArguments(options);
058                lsArgs.setPaths(paths);
059                return new LsCommand(lsArgs);
060        }
061}