Coverage Report - org.jtheque.films.controllers.impl.ImportController
 
Classes in this File Line Coverage Branch Coverage Complexity
ImportController
0 %
0/8
N/A
1
 
 1  
 package org.jtheque.films.controllers.impl;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License.
 9  
  *
 10  
  * JTheque is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
  * GNU General Public License for more details.
 14  
  *
 15  
  * You should have received a copy of the GNU General Public License
 16  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.core.managers.view.able.controller.AbstractController;
 20  
 import org.jtheque.films.controllers.able.IImportController;
 21  
 import org.jtheque.films.services.impl.utils.file.imports.ImportManager;
 22  
 import org.jtheque.films.services.impl.utils.file.jt.FileFilterFactory;
 23  
 import org.jtheque.films.utils.Constants.Files.FileType;
 24  
 import org.jtheque.films.view.able.IImportView;
 25  
 import org.jtheque.utils.io.FileException;
 26  
 
 27  
 import javax.annotation.Resource;
 28  
 
 29  
 /**
 30  
  * Controller of the import view.
 31  
  *
 32  
  * @author Baptiste Wicht
 33  
  */
 34  0
 public final class ImportController extends AbstractController implements IImportController {
 35  
     private FileType fileType;
 36  
 
 37  
     @Resource
 38  
     private IImportView importView;
 39  
 
 40  
     @Override
 41  
     public void openImportView(FileType fileType) {
 42  0
         this.fileType = fileType;
 43  
 
 44  0
         getView().sendMessage("filter", FileFilterFactory.getFileFilter(fileType));
 45  0
         displayView();
 46  0
     }
 47  
 
 48  
     @Override
 49  
     public void importData(String filePath) throws FileException {
 50  0
         ImportManager.importFrom(fileType, filePath);
 51  0
     }
 52  
 
 53  
     @Override
 54  
     public IImportView getView() {
 55  0
         return importView;
 56  
     }
 57  
 }