mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +08:00
FileStorageAPI#fileExists method #PL-4817
This commit is contained in:
parent
cb41cea6be
commit
f20b8719bd
@ -1,14 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2008-2013 Haulmont. All rights reserved.
|
||||
* Copyright (c) 2008-2015 Haulmont. All rights reserved.
|
||||
* Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
*/
|
||||
package com.haulmont.cuba.core.app;
|
||||
|
||||
import com.haulmont.cuba.core.Locator;
|
||||
import com.haulmont.cuba.core.entity.FileDescriptor;
|
||||
import com.haulmont.cuba.core.global.FileStorageException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* @author krivopustov
|
||||
* @version $Id$
|
||||
@ -16,27 +17,26 @@ import org.springframework.stereotype.Service;
|
||||
@Service(FileStorageService.NAME)
|
||||
public class FileStorageServiceBean implements FileStorageService {
|
||||
|
||||
@Inject
|
||||
FileStorageAPI fileStorageAPI;
|
||||
|
||||
@Override
|
||||
public void saveFile(FileDescriptor fileDescr, byte[] data) throws FileStorageException {
|
||||
FileStorageAPI mbean = Locator.lookup(FileStorageAPI.NAME);
|
||||
mbean.saveFile(fileDescr, data);
|
||||
fileStorageAPI.saveFile(fileDescr, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFile(FileDescriptor fileDescr) throws FileStorageException {
|
||||
FileStorageAPI mbean = Locator.lookup(FileStorageAPI.NAME);
|
||||
mbean.removeFile(fileDescr);
|
||||
fileStorageAPI.removeFile(fileDescr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] loadFile(FileDescriptor fileDescr) throws FileStorageException {
|
||||
FileStorageAPI mbean = Locator.lookup(FileStorageAPI.NAME);
|
||||
return mbean.loadFile(fileDescr);
|
||||
return fileStorageAPI.loadFile(fileDescr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fileExists(FileDescriptor fileDescr) {
|
||||
FileStorageAPI mbean = Locator.lookup(FileStorageAPI.NAME);
|
||||
return mbean.fileExists(fileDescr);
|
||||
return fileStorageAPI.fileExists(fileDescr);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user