@@ -0,0 +1,1988 @@
+/*%0A * Copyright (C) 2015 Atanas Gegov%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.atanasg.fileprocessingapp.commands;%0A%0Aimport java.util.List;%0A%0Aimport com.atanasg.fileprocessingapp.command.status.CommandExecStatus;%0Aimport com.atanasg.fileprocessingapp.command.status.CommandFailed;%0Aimport com.atanasg.fileprocessingapp.command.status.CommandSuccessful;%0Aimport com.atanasg.fileprocessingapp.mvc.model.FileContentModel;%0Aimport com.atanasg.fileprocessingapp.mvc.view.FileProcessingAppView;%0A%0A/**%0A * Get the file content currently stored in the%0A * %7B@link FileContentModel%7D and forward to the%0A * %7B@link FileProcessingAppView%7D that shows it%0A * to the user.%0A *%0A * @author Atanas Gegov%0A */%0Apublic class PrintCommand extends AbstractCommand %7B%0A%0A%09public PrintCommand(FileContentModel fileContentModel,%0A%09%09%09FileProcessingAppView userInterface) %7B%0A%09%09super(fileContentModel, userInterface);%0A%09%7D%0A%0A%09@Override%0A%09public void execute() %7B%0A%09%09CommandExecStatus printCommandStatus;%0A%0A%09%09userInterface.showInfoForCommandInProgress(%22Printing current content...%22);%0A%09%09List%3CString%3E fileLines = fileContentModel.getFileContentAsFileLines();%0A%0A%09%09if(fileLines.isEmpty()) %7B%0A%09%09%09printCommandStatus = new CommandFailed();%0A%09%09%09printCommandStatus.appendDetailedInfo(%22No content found%22);%0A%09%09%7D else %7B%0A%09%09%09printCommandStatus = new CommandSuccessful();%0A%09%09%09for(String line : fileLines) %7B%0A%09%09%09%09printCommandStatus.appendDetailedInfo(line);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09userInterface.showCommandExecutionStatus(printCommandStatus);%0A%09%7D%0A%0A%7D%0A

Add a new class for a print command