Set a breakpoint at the given file and line with a condition.

@param file
The file name
@param line
The line number
@param condition
Any condition for the breakpoint, or null
@throws Exception
Problems parsing condition.
964640
private void setBreakpoint(File file, int line, String condition)
			throws Exception
	{
		if (file == null)
		{
			file = interpreter.getDefaultFile();
		}

		if (file == null || file.getPath().equals("?"))
		{
			Set<File> files = interpreter.getSourceFiles();

			if (files.size() > 1)
			{
				println("Assuming file " + file.getPath());
			} else if (files.isEmpty())
			{
				println("No files defined");
				return;
			}

			file = files.iterator().next();
		}

		PStm stmt = interpreter.findStatement(file, line);

		if (stmt == null)
		{
			PExp exp = interpreter.findExpression(file, line);

			if (exp == null)
			{
				println("No breakable expressions or statements at " + file
						+ ":" + line);
			} else
			{
				interpreter.clearBreakpoint(BreakpointManager.getBreakpoint(exp).number);
				Breakpoint bp = interpreter.setBreakpoint(exp, condition);
				println("Created " + bp);
				println(interpreter.getSourceLine(bp.location));
			}
		} else
		{
			interpreter.clearBreakpoint(BreakpointManager.getBreakpoint(stmt).number);
			Breakpoint bp = interpreter.setBreakpoint(stmt, condition);
			println("Created " + bp);
			println(interpreter.getSourceLine(bp.location));
		}
	}
779666
public void setFile(File file) throws FileNotFoundException{
		this.setInputStream(new BufferedInputStream(new FileInputStream(file)), file.length());
		this.isUploadFile = true;
	}
1112198
private File processFile(File file) throws Exception {
        List<String> original = readFile(file);
        List<String> content = new ArrayList<>(original);
        BeanGen gen;
        try {
            BeanParser parser = new BeanParser(file, content, config);
            gen = parser.parse();
        } catch (BeanCodeGenException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new BeanCodeGenException(ex.getMessage(), ex, file);
        }
        if (gen.isBean()) {
            if (verbosity >= 2) {
                System.out.print(file + "  [processing]");
            }
            gen.process();
            if (content.equals(original) == false) {
                if (write) {
                    if (verbosity >= 2) {
                        System.out.println(" [writing]");
                    } else if (verbosity == 1) {
                        System.out.println(file + "  [writing]");
                    }
                    writeFile(file, content);
                } else {
                    if (verbosity >= 2) {
                        System.out.println(" [changed not written]");
                    } else if (verbosity == 1) {
                        System.out.println(file + "  [changed not written]");
                    }
                }
                return file;
            } else {
                if (verbosity >= 2) {
                    System.out.println(" [no change]");
                }
            }
        } else {
            gen.processNonBean();
            if (!content.equals(original)) {
                if (write) {
                    if (verbosity >= 2) {
                        System.out.println(" [writing]");
                    } else if (verbosity == 1) {
                        System.out.println(file + "  [writing]");
                    }
                    writeFile(file, content);
                } else {
                    if (verbosity >= 2) {
                        System.out.println(" [changed not written]");
                    } else if (verbosity == 1) {
                        System.out.println(file + "  [changed not written]");
                    }
                }
                return file;
            } else {
                if (verbosity == 3) {
                    System.out.println(file + "  [ignored]");
                }
            }
        }
        return null;
    }
90285
public void setErrorMessage(Throwable exception) {
		if (exception != null) {
			String message = exception.getLocalizedMessage();
			if (Strings.isNullOrEmpty(message)) {
				message = exception.getMessage();
			}
			if (Strings.isNullOrEmpty(message)) {
				message = MessageFormat.format(Messages.SREsPreferencePage_9, exception.getClass().getName());
			}
			setErrorMessage(message);
		}
	}
936710
public synchronized void parseLine(String line) throws SyntaxErrorException
	{
		if (null != getParserOutcome() && isParserOutcomeMultipleLine())
		{
			parseLine__multipleLineMode(line);
		}
		else
		{
			parseLine__singleLineMode(line);
		}
	}
1318945
public void addFile(File file) {
        if (file != null && file.exists()) {
            try {
                classPath.add(file.toURI().toURL());
            } catch (MalformedURLException e) {
                throw new AssertionError("converting an existing file to an url should have never thrown an exception!");
            }
        }
    }
953937
public void write(File file) throws Exception {
        try {
            FileOutputStream fos = new FileOutputStream(file);
            write(fos);
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
582599
public void open(String file) throws IOException {
            filename = file;
            if(fd>0) {
                throw new IOException("File "+filename+" already open.");
            }
            fd = WDT.open(file);
            if(fd<0) {
                throw new IOException("Cannot open file handle for " + filename + " got " + fd + " back.");
            }
    }
627075
protected void println(String line) {
        if (output instanceof PrintStream) {
            ((PrintStream) output).println(line);
        } else {
            ((PrintWriter) output).println(line);
        }
    }
1324562
public Value execute(File file) throws Exception
	{
		BufferedReader br = new BufferedReader(new FileReader(file));
		StringBuilder sb = new StringBuilder();

		String line = br.readLine();

		while (line != null)
		{
			sb.append(line);
			line = br.readLine();
		}

		br.close();

		Value result = execute(sb.toString(), null);

		BasicSchedulableThread.terminateAll(); // NB not a session (used for tests)
		return result;
	}
269250
public static void checkValidFile(final File file) {
        checkNotNull("file", file);
        if (!file.exists()) {
            throw new IllegalArgumentException("The file '" + file + "' does not exist!");
        }
        if (!file.isFile()) {
            throw new IllegalArgumentException("The name '" + file + "' is not a file!");
        }
    }
16359
public void loadFile(File file)
   {
      InputStream is = null;

      try
      {
         is = new FileInputStream(file);
         POIFSFileSystem fs = new POIFSFileSystem(is);
         m_model.setFile(fs);
      }

      catch (IOException ex)
      {
         throw new RuntimeException(ex);
      }

      finally
      {
         StreamHelper.closeQuietly(is);
      }
   }
24179
@Override
    public void setFile(File file) {
        configFile = file;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Jaspi configuration of persistent providers will be stored in file: " + file);
    }
131719
void setAttribute(File file, String attribute, Object value) {
    state.checkOpen();
    // TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
    attributes.setAttribute(file, attribute, value, false);
  }
174884
private void delete(File file) {

		// Assertions.
		if (file == null) {
			String msg = "Argument 'file' cannot be null.";
			throw new IllegalArgumentException(msg);
		}

		if (file.isDirectory()) {
			for (File f : file.listFiles()) {
				delete(f);
			}
		}

		file.delete();

	}
911626
public static Exception checkFile(final File file)
	{
		Exception ex = null;
		String error = null;
		// check if the file does not exists...
		if (!file.exists())
		{
			error = "The " + file + " does not exists.";
			ex = new FileDoesNotExistException(error);
			return ex;
		}
		// check if the file is not a directory...
		if (!file.isDirectory())
		{
			error = "The " + file + " is not a directory.";
			ex = new FileIsNotADirectoryException(error);
			return ex;
		}

		final File[] ff = file.listFiles();
		// If the file is null
		if (ff == null)
		{ // it is security restricted
			error = "The " + file + " could not list the content.";
			ex = new DirectoryHasNoContentException(error);
		}
		return ex;
	}
975874
public void processFile(File file) {
    TreeReader tr = null;

    // SRL stuff
    CollectionValuedMap<Integer,String> srlMap = null;
    if (this.srlMap != null) {
      // there must be a better way ...
      String filename = file.getAbsolutePath();
      for (String suffix : this.srlMap.keySet()) {
        if (filename.endsWith(suffix)) {
          srlMap = this.srlMap.get(suffix);
          break;
        }
      }
      if (srlMap == null) {
        System.err.println("could not find SRL entries for file: "+file);
      }
    }

    try {
      // maybe print file name to stdout to get some feedback
      if (PRINT_FILENAMES) {
        System.err.println(file);
      }
      // could throw an IO exception if can't open for reading
      tr = treeReaderFactory().newTreeReader(new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding())));
      int sentIndex=0;
      Tree pt;
      while ((pt = tr.readTree()) != null) {
        if (pt.label() instanceof HasIndex) { // so we can trace where this tree came from
          HasIndex hi = (HasIndex) pt.label();
          hi.setDocID(file.getName());
          hi.setSentIndex(sentIndex);
        }
        if (srlMap == null) {
          parseTrees.add(pt);
        } else {
          Collection<String> srls = srlMap.get(sentIndex);
//           pt.pennPrint();
//           System.err.println(srls);
          parseTrees.add(pt);
          if (srls.isEmpty()) {
//            parseTrees.add(pt);
          } else {
            for (String srl : srls) {
//              Tree t = pt.deepCopy();
              String[] bits = srl.split("\\s+");
              int verbIndex = Integer.parseInt(bits[0]);
              String lemma = bits[2].split("\\.")[0];
//              Tree verb = Trees.getTerminal(t, verbIndex);
              Tree verb = Trees.getTerminal(pt, verbIndex);
//              ((CoreLabel)verb.label()).set(SRLIDAnnotation.class, SRL_ID.REL);
              ((CoreLabel)verb.label()).set(CoreAnnotations.CoNLLPredicateAnnotation.class, true);
              for (int i = 4; i < bits.length; i++) {
                String arg = bits[i];
                String[] bits1;
                if (arg.indexOf("ARGM") >= 0) {
                  bits1 = arg.split("-");
                } else {
                  bits1 = arg.split("-");
                }
                String locs = bits1[0];
                String argType = bits1[1];
                if (argType.equals("rel")) {
                  continue;
                }
                for (String loc : locs.split("[*,]")) {
                  bits1 = loc.split(":");
                  int term = Integer.parseInt(bits1[0]);
                  int height = Integer.parseInt(bits1[1]);
//                  Tree t1 = Trees.getPreTerminal(t, term);
                  Tree t1 = Trees.getPreTerminal(pt, term);
                  for (int j = 0; j < height; j++) {
//                    t1 = t1.parent(t);
                    t1 = t1.parent(pt);
                  }
                  Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class);
                  if (roleMap == null) {
                    roleMap = new HashMap<Integer, String>();
                    ((CoreLabel)t1.label()).set(CoreAnnotations.CoNLLSRLAnnotation.class, roleMap);
                  }
                  roleMap.put(verbIndex, argType);
//                  ((CoreLabel)t1.label()).set(SRLIDAnnotation.class, SRL_ID.ARG);
                }
              }
//               for (Tree t1 : t) {
//                 if (t1.isLeaf()) { continue; }
//                 CoreLabel fl = (CoreLabel)t1.label();
//                 if (fl.value() == null) { continue; }
//                 if (!fl.has(SRLIDAnnotation.class)) {
//                   boolean allNone = true;
//                   for (Tree t2 : t1) {
//                     SRL_ID s = ((CoreLabel)t2.label()).get(SRLIDAnnotation.class);
//                     if (s == SRL_ID.ARG || s == SRL_ID.REL) {
//                       allNone = false;
//                       break;
//                     }
//                   }
//                   if (allNone) {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.ALL_NO);
//                   } else {
//                     fl.set(SRLIDAnnotation.class, SRL_ID.NO);
//                   }
//                 }
//               }
//              parseTrees.add(t);
            }
          }
        }

        sentIndex++;
      }
    } catch (IOException e) {
      System.err.println("loadTree IO Exception: " + e + " in file " + file);
    } finally {
      try {
        if (tr != null) {
          tr.close();  // important: closes file even if error!
        }
      } catch (IOException e) {
        // do nothin'
      }
    }
  }