- boolean canWriteIndexFile = false;
-
- if (indexFile.exists()) {
- // if file already exists, make sure that we can overwrite
- // it
- final FileReader fileReader = new FileReader(indexFile);
- final BufferedReader reader = new BufferedReader(fileReader);
-
- parseFile: {
- while (true) {
- final String line = reader.readLine();
-
- if (line == null)
- break parseFile;
-
- if (line.contains(Constants.HTML_MAGIC_STRING)) {
- canWriteIndexFile = true;
- break parseFile;
- }
- }
- }
-
- reader.close();
- fileReader.close();
- } else
- canWriteIndexFile = true;
- return canWriteIndexFile;
- }