X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Futils%2FReadFromFile.java;fp=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Futils%2FReadFromFile.java;h=0000000000000000000000000000000000000000;hp=343962bb24aabf3d58025c842b719bf4f102d4fb;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ReadFromFile.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ReadFromFile.java deleted file mode 100644 index 343962bb24..0000000000 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ReadFromFile.java +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -package org.opendaylight.controller.sal.utils; - -import java.io.BufferedReader; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.ArrayList; - -/** - * Convenience object for reading from file - * - * - * - */ -public class ReadFromFile { - private FileInputStream fileStream; - private File filePointer; - - public ReadFromFile(String fileName) throws FileNotFoundException { - fileStream = new FileInputStream(fileName); - filePointer = new File(fileName); //needed to allow file deletion - } - - public ArrayList readFile() throws IOException { - DataInputStream dataInput = new DataInputStream(this.fileStream); - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(dataInput)); - - ArrayList lineList = new ArrayList(); - String line; - while ((line = bufferedReader.readLine()) != null) { - lineList.add(line); - } - bufferedReader.close(); - dataInput.close(); - fileStream.close(); - return lineList; - } - - public boolean delete() { - if (filePointer == null) { - return true; - } - return filePointer.delete(); - } -} \ No newline at end of file