public ProjectFile(UploadedFile uploadedFile) { this.name = FileUtils.getName(uploadedFile.getName()); this.size = uploadedFile.getSize(); this.uploadedFile = uploadedFile; }
public ProjectFile(UploadedFile uploadedFile) { this.name = FileUtils.getName(uploadedFile.getName()); this.size = uploadedFile.getSize(); this.uploadedFile = uploadedFile; }
public String getDisplayName() { String uri = StringTool.decodeURL(src.getUri()); return FileUtils.getName(uri); }
String name = FileUtils.getName(item.getName());
String name = FileUtils.getName(item.getName());
public String compare() { // Fix Ctrl+R in browser if (uploadedFiles.size() >= MAX_FILES_COUNT) { // Clear selection to handle NPE bug. See EPBDS-3992 for details. UITree treeComponent = (UITree) FacesContext.getCurrentInstance().getViewRoot().findComponent("diffTreeForm:newTree"); treeComponent.setSelection(new ArrayList<>()); deleteTempFiles(); List<File> filesToCompare = new ArrayList<>(); for (UploadedFile uploadedFile : uploadedFiles) { File fileToCompare = FileTool.toTempFile( uploadedFile.getInputStream(), FileUtils.getName(uploadedFile.getName())); filesToCompare.add(fileToCompare); // Files can be reloaded lazily later. We can't delete them immediately. Instead delete them when Bean // is destroyed (on session timeout) or before next comparison. addTempFile(fileToCompare); } compare(filesToCompare); // Clear uploaded files uploadedFiles.clear(); } return null; }
public String compare() { // Fix Ctrl+R in browser if (uploadedFiles.size() >= MAX_FILES_COUNT) { // Clear selection to handle NPE bug. See EPBDS-3992 for details. UITree treeComponent = (UITree) FacesContext.getCurrentInstance().getViewRoot().findComponent("diffTreeForm:newTree"); treeComponent.setSelection(new ArrayList<>()); deleteTempFiles(); List<File> filesToCompare = new ArrayList<>(); for (UploadedFile uploadedFile : uploadedFiles) { File fileToCompare = FileTool.toTempFile( uploadedFile.getInputStream(), FileUtils.getName(uploadedFile.getName())); filesToCompare.add(fileToCompare); // Files can be reloaded lazily later. We can't delete them immediately. Instead delete them when Bean // is destroyed (on session timeout) or before next comparison. addTempFile(fileToCompare); } compare(filesToCompare); // Clear uploaded files uploadedFiles.clear(); } return null; }
public XlsWorkbookSourceCodeModule getCurrentModuleWorkbook() { PathEntry rulesRootPath = studio.getCurrentModule().getRulesRootPath(); WorkbookSyntaxNode[] workbookNodes = getWorkbookNodes(); if (workbookNodes == null) { return null; } for (WorkbookSyntaxNode workbookSyntaxNode : workbookNodes) { XlsWorkbookSourceCodeModule module = workbookSyntaxNode.getWorkbookSourceCodeModule(); if (rulesRootPath != null && module.getSourceFile().getName().equals(FileUtils.getName(rulesRootPath.getPath()))) { return module; } } return null; }
public XlsWorkbookSourceCodeModule getCurrentModuleWorkbook() { PathEntry rulesRootPath = studio.getCurrentModule().getRulesRootPath(); WorkbookSyntaxNode[] workbookNodes = getWorkbookNodes(); if (workbookNodes == null) { return null; } for (WorkbookSyntaxNode workbookSyntaxNode : workbookNodes) { XlsWorkbookSourceCodeModule module = workbookSyntaxNode.getWorkbookSourceCodeModule(); if (rulesRootPath != null && module.getSourceFile().getName().equals(FileUtils.getName(rulesRootPath.getPath()))) { return module; } } return null; }
XlsWorkbookSourceCodeModule module = workbookSyntaxNode.getWorkbookSourceCodeModule(); boolean currentModule = this.moduleInfo.getRulesRootPath() == null || module.getSourceFile().getName().equals(FileUtils.getName(this.moduleInfo.getRulesRootPath().getPath())); module.getWorkbookLoader().setCanUnload(!currentModule);