diff options
Diffstat (limited to 'aai-resources/src/test/java/org/onap/aai/util/DbTestGetFileTime.java')
-rw-r--r-- | aai-resources/src/test/java/org/onap/aai/util/DbTestGetFileTime.java | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/aai-resources/src/test/java/org/onap/aai/util/DbTestGetFileTime.java b/aai-resources/src/test/java/org/onap/aai/util/DbTestGetFileTime.java deleted file mode 100644 index fb1f1ee..0000000 --- a/aai-resources/src/test/java/org/onap/aai/util/DbTestGetFileTime.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * ============LICENSE_START======================================================= - * org.onap.aai - * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ -package org.onap.aai.util; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributeView; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; - -public class DbTestGetFileTime { - - - /** - * Creates the file return time. - * - * @param path the path - * @return the file time - * @throws IOException Signals that an I/O exception has occurred. - */ - public FileTime createFileReturnTime( String path) throws IOException { - File file = new File(path); - if(!file.exists()) { - file.createNewFile(); - } - Path p = Paths.get(file.getAbsolutePath()); - BasicFileAttributes view - = Files.getFileAttributeView(p, BasicFileAttributeView.class) - .readAttributes(); - FileTime fileTime=view.creationTime(); - // also available view.lastAccessTine and view.lastModifiedTime - return fileTime; - } -} |