@Override public String getNameExt() { return fileObj.getNameExt(); }
@Override public String getNameExt() { return delegate.getNameExt(); }
public boolean match(FileObject fo) { String nameAndExt = fo.getNameExt(); if (ignoreCase) { nameAndExt = nameAndExt.toLowerCase(); } if (substring) { return nameAndExt.contains(name); } else { return nameAndExt.equals(name); } }
private static boolean sameFullName(FileObject f1, FileObject f2) { while (f1 != null && f2 != null) { if (!f1.getNameExt().equals(f2.getNameExt())) { return false; } f1 = f1.getParent(); f2 = f2.getParent(); } return f1 == null && f2 == null; }
lit.append(fobia[i].getNameExt()); name = lit.toString();
/** Constructs path of file. * @param arr to place the string buffer * @param sepChar separator character */ private void constructName(StringBuilder[] arr, char sepChar, int lengthSoFar) { String myName = getNameExt(); int myLen = lengthSoFar + myName.length(); FileObject parent = getParent(); if (parent == this) { Object fs; try { fs = getFileSystem(); } catch (IOException ex) { fs = "unknown"; // NOI18N } throw new IllegalStateException("Dangerous self-reproductive parentship: " + this + " type: " + getClass() + " fs: " + fs); // NOI18N } if ((parent != null) && !parent.isRoot()) { parent.constructName(arr, sepChar, myLen + 1); arr[0].append(sepChar); } else { assert arr[0] == null; arr[0] = new StringBuilder(myLen); } arr[0].append(getNameExt()); }
/** * Return the revived file from the MFS * @return the revived file, if the operation succeeds. * @throws IOException from the deletion of the masking file. */ @Override public FileObject call() throws IOException { if (maskFile.isValid()) { maskFile.delete(); } return MultiFileObject.this.getFileObject(maskFile.getNameExt()); }
/** Get fully-qualified filename. Does so by walking through all folders * to the root of the filesystem. Separates files with provided <code>separatorChar</code>. * The extension, if present, is separated from the basename with <code>extSepChar</code>. * <p><strong>Note:</strong> <samp>fo.getPath()</samp> will have the * same effect as using this method with <samp>/</samp> and <samp>.</samp> (the standard * path and extension delimiters). * @param separatorChar char to separate folders and files * @param extSepChar char to separate extension * @return the fully-qualified filename * @deprecated Please use the <a href="@org-netbeans-api-java-classpath@/org/netbeans/api/java/classpath/ClassPath.html">ClassPath API</a> instead. */ @Deprecated public String getPackageNameExt(char separatorChar, char extSepChar) { assert false : "Deprecated."; if (isRoot() || getParent().isRoot()) { return getNameExt(); } StringBuilder[] arr = new StringBuilder[1]; getParent().constructName(arr, separatorChar, 50); String ext = getExt(); if ((ext == null) || ext.equals("")) { // NOI18N arr[0].append(separatorChar).append(getNameExt()); } else { arr[0].append(separatorChar).append(getName()).append(extSepChar).append(getExt()); } return arr[0].toString(); }
String name = arr[i].getNameExt();
/** Get fully-qualified filename, but without extension. * Like {@link #getPackageNameExt} but omits the extension. * @param separatorChar char to separate folders and files * @return the fully-qualified filename * @deprecated Please use the <a href="@org-netbeans-api-java-classpath@/org/netbeans/api/java/classpath/ClassPath.html">ClassPath API</a> instead. */ @Deprecated public String getPackageName(char separatorChar) { assert false : "Deprecated."; if (isRoot() || getParent().isRoot()) { return (isFolder()) ? getNameExt() : getName(); } StringBuilder[] arr = new StringBuilder[1]; String name = getName(); getParent().constructName(arr, separatorChar, name.length()); arr[0].append(separatorChar).append(name); return arr[0].toString(); }
while (it.hasNext()) { FileObject child = it.next(); if (childrenByName.put(child.getNameExt(), child) != null) { throw new IllegalArgumentException("Duplicate in children list: " + child.getPath() + "\nChildren: " + children); // NOI18N List<String> missingNames = new ArrayList<String>(missingPositions.size()); for (FileObject f : missingPositions) { final String n = f.getNameExt(); if (n.contains("ergonomics")) { // NOI18N break IGNORE_ERGO; final String n = cap.child.getNameExt(); if (n.contains("ergonomics")) { // NOI18N break IGNORE_ERGO;
String parentPath = writableFolder.getPath(); for (FileObject mask : ch) { String fn = mask.getNameExt(); if (fn.endsWith(MultiFileSystem.MASK)) { fn = fn.substring(0, fn.length() - MultiFileSystem.MASK.length());
/** Converts the file to be writable. * The file has to be locked! * * @return file object (new leader) that is writable * @exception IOException if the object cannot be writable */ private FileObject writable(boolean copyContents) throws IOException { MultiFileSystem fs = getMultiFileSystem(); FileSystem single = fs.createWritableOn(getPath()); if (single != leader.getFileSystem()) { // if writing to a file that is not on writable fs => // copy it if (leader.isFolder()) { leader = FileUtil.createFolder(root(single), getPath()); } else { FileObject folder = FileUtil.createFolder(root(single), getParent().getPath()); if (copyContents) { leader = leader.copy(folder, leader.getName(), leader.getExt()); } else { leader = folder.createData(leader.getNameExt()); } } MfLock l = ((lock == null) ? null : lock.get()); if (l != null) { // update the lock l.addLock(leader); } } return leader; }
@Override public String getIn() { if (in == null) { if (file != null) { in = file.getNameExt(); } } return in; }
@Override public boolean accept(FileObject pathname) { return !excludePattern.matcher(pathname.getNameExt()).find(); } }
@Override public String getName() { String ename = getPrimaryFile().getNameExt(); return ename; }
@Override public void fileDataCreated(FileEvent fe) { if (FILE_DD.equals(fe.getFile().getNameExt())) { webInf.removeFileChangeListener(this); resetMetadataModel(); } } });
public void fileChanged(FileEvent fileEvent) { if (!isFolder) { String nameExt = fileEvent.getFile().getNameExt(); if (Arrays.binarySearch(filesToWatch, nameExt) != -1) { ProjectURLWatcher.fireMavenProjectReload(NbMavenProject.this); } } }
@Override public void fileDeleted(FileEvent fe) { if ("settings.xml".equals(fe.getFile().getNameExt())) { fe.getFile().removeFileChangeListener(this); synchronized (EmbedderFactory.class) { online = null; project = null; } } }
@CheckForNull ProjectConvertor.Result isProject(@NonNull final FileObject folder) { for (FileObject fo : folder.getChildren()) { if (requiredPattern.matcher(fo.getNameExt()).matches()) { return getProjectConvertor().isProject(folder); } } return null; }