/** * Creates a new {@code FileContents} instance. * * @param text the contents of the file */ public FileContents(FileText text) { fileName = text.getFile().toString(); this.text = new FileText(text); }
@Override public void beginTree(DetailAST rootAST) { currentImportControl = null; processCurrentFile = path.matcher(getFileContents().getFileName()).find(); fileName = getFileContents().getText().getFile().getName(); final int period = fileName.lastIndexOf('.'); if (period != -1) { fileName = fileName.substring(0, period); } }
@Test public void testTextFileName() { final FileContents fileContents = new FileContents("filename", "123", "456"); assertEquals("Invalid file name", "filename", fileContents.getText().getFile().getName()); }
/** * Creates a new {@code FileContents} instance. * * @param text the contents of the file */ public FileContents(FileText text) { fileName = text.getFile().toString(); this.text = new FileText(text); }
@Override public void beginTree(DetailAST rootAST) { currentImportControl = null; processCurrentFile = path.matcher(getFileContents().getFileName()).find(); fileName = getFileContents().getText().getFile().getName(); final int period = fileName.lastIndexOf('.'); if (period != -1) { fileName = fileName.substring(0, period); } }