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