fix codacy

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-01-18 07:10:40 +01:00 committed by Andy Scherzinger
parent 3ca95252c4
commit 159aacdd15
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -337,16 +337,16 @@ public class DocumentsStorageProvider extends DocumentsProvider {
@Override @Override
public String copyDocument(String sourceDocumentId, String targetParentDocumentId) throws FileNotFoundException { public String copyDocument(String sourceDocumentId, String targetParentDocumentId) throws FileNotFoundException {
long sourceId = Long.parseLong(sourceDocumentId); long sourceId = Long.parseLong(sourceDocumentId);
long targetId = Long.parseLong(targetParentDocumentId);
updateCurrentStorageManagerIfNeeded(sourceId); updateCurrentStorageManagerIfNeeded(sourceId);
OCFile file = currentStorageManager.getFileById(sourceId); OCFile file = currentStorageManager.getFileById(sourceId);
OCFile targetFolder = currentStorageManager.getFileById(targetId);
if (file == null) { if (file == null) {
throw new FileNotFoundException("File " + sourceDocumentId + " not found!"); throw new FileNotFoundException("File " + sourceDocumentId + " not found!");
} }
long targetId = Long.parseLong(targetParentDocumentId);
OCFile targetFolder = currentStorageManager.getFileById(targetId);
if (targetFolder == null) { if (targetFolder == null) {
throw new FileNotFoundException("File " + targetParentDocumentId + " not found!"); throw new FileNotFoundException("File " + targetParentDocumentId + " not found!");
} }