* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.util;
import java.io.File;
* Utility class to read/delete contents of log file
*/
public class LogFile {
-
+
public static String getContents(String fileName) throws IOException {
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream("logs/" + fileName);
contents = IOUtils.toString(fileInputStream, "UTF-8");
- }
- finally {
- if (fileInputStream != null) fileInputStream.close();
+ } finally {
+ if (fileInputStream != null)
+ fileInputStream.close();
}
return contents;
}
+
public static void deleteContents(String fileName) throws IOException {
FileUtils.write(new File("logs/" + fileName), "", Charset.defaultCharset());
}