001package org.unix4j.unix.ls;
002
003import java.io.File;
004
005import org.unix4j.line.SimpleLine;
006import org.unix4j.processor.LineProcessor;
007import org.unix4j.util.FileUtil;
008
009class LsFormatterShort implements LsFormatter {
010        
011        static final LsFormatterShort INSTANCE = new LsFormatterShort();
012        
013        @Override
014        public boolean writeFormatted(File relativeTo, File file, LsArguments args, LineProcessor output) {
015                final String relativePath = FileUtil.getRelativePath(relativeTo, file);
016                return output.processLine(new SimpleLine(relativePath));
017        }
018        
019        //constructor used only for singleton INSTANCE
020        private LsFormatterShort() {
021                super();
022        }
023}