summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src/main
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-10-22 08:30:19 -0500
committerInstrumental <jonathan.gathman@att.com>2018-10-22 08:31:14 -0500
commite3093b8d1b19ad92a4af90df39a2087f40a687d4 (patch)
treecc2037c3479ba4e74898d9a2525c9ae47ff1c97b /auth/auth-core/src/main
parentc03496d36fc7e0a2978c84cb443550c565eedb84 (diff)
Final Sonar reds
Issue-ID: AAF-580 Change-Id: I99de4518853504c2a211e92bce3dba70c8bc6a76 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-core/src/main')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java27
1 files changed, 0 insertions, 27 deletions
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
index 9af11152..ce87533e 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
@@ -291,33 +291,6 @@ public class CachingFileAccess<TRANS extends Trans> extends HttpCode<TRANS, Void
return c;
}
- public Content loadOrDefault(Trans trans, String targetDir, String targetFileName, String sourcePath, String mediaType) throws IOException {
- try {
- return load(trans.info(),targetDir,targetFileName,mediaType,0);
- } catch (FileNotFoundException e) {
- String targetPath = targetDir + '/' + targetFileName;
- TimeTaken tt = trans.start("File doesn't exist; copy " + sourcePath + " to " + targetPath, Env.SUB);
- try {
- FileInputStream sourceFIS = new FileInputStream(sourcePath);
- FileChannel sourceFC = sourceFIS.getChannel();
- File targetFile = new File(targetPath);
- targetFile.getParentFile().mkdirs(); // ensure directory exists
- FileOutputStream targetFOS = new FileOutputStream(targetFile);
- try {
- ByteBuffer bb = ByteBuffer.allocate((int)sourceFC.size());
- sourceFC.read(bb);
- bb.flip(); // ready for reading
- targetFOS.getChannel().write(bb);
- } finally {
- sourceFIS.close();
- targetFOS.close();
- }
- } finally {
- tt.done();
- }
- return load(trans.info(),targetDir,targetFileName,mediaType,0);
- }
- }
public void invalidate(String key) {
content.remove(key);