View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.mobility.file.service;
17  
18  import java.util.List;
19  
20  import org.kuali.mobility.file.dao.FileDao;
21  import org.kuali.mobility.file.entity.File;
22  import org.springframework.beans.factory.annotation.Autowired;
23  import org.springframework.stereotype.Service;
24  import org.springframework.transaction.annotation.Transactional;
25  
26  @Service
27  public class FileServiceImpl implements FileService {
28  
29  	private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(FileServiceImpl.class);		
30  	private String ME = this.getClass().getName();
31  	
32  	@Autowired
33  	private FileDao fileDao;
34  	
35  	@Override
36  	@Transactional
37  	public Long saveFile(File file){
38  		return fileDao.saveFile(file);
39  	}
40  
41  	@Transactional
42  	public boolean removeFile(File file){
43  		return fileDao.removeFile(file);
44  	}	
45  	
46  	@Transactional
47  	public File findFileById(Long Id){
48  		return fileDao.findFileById(Id);
49  	}
50  	
51  	@Transactional
52  	public List<File> findFilesByName(String name){
53  		return fileDao.findFilesByName(name);
54  	}
55  
56  	@Transactional
57  	public List<File> findAllFiles(){
58  		return fileDao.findAllFiles();
59  	}
60  	
61  	@Autowired
62  	private FileDao dao;
63  	public void setFileDao(FileDao dao){
64  		this.dao = dao;
65  	}
66  	public FileDao getFileDao(){
67  		return dao;
68  	}
69  	
70  	
71  }