@Override public String getFileName() { return _file.getName(); }
@Override public String getFileName() { return _file.getName(); }
@Override public String getNonCanonicalFileName() { return _file.getName(); }
@Override public String getNonCanonicalFileName() { return _file.getName(); }
@Override public String getFileName() { return _file.getName(); }
public static String getBaseName(IFile file) { return getBaseName( file.getName() ); }
public static String getBaseName(IFile file) { return getBaseName( file.getName() ); }
private boolean shouldConsiderFile(IFile entry, TestClassFindType findType) { // Skip everything other than Java and Gosu classes that end in "Test", depending on the find type if (findType == TestClassFindType.JAVA) { if (!entry.getName().endsWith("Test.class")) { return false; } } else if (findType == TestClassFindType.GOSU) { if (!entry.getName().endsWith("Test.gs")) { return false; } } else { throw new IllegalArgumentException("Unexpected find type " + findType); } for (Predicate<IFile> fileFilter : _iFileFilters) { if (!fileFilter.evaluate(entry)) { return false; } } // If it passed through all the filters, then we don't want to skip the type return true; }
@Override public boolean handlesFile( IFile file ) { return FILE_EXTENSION.equalsIgnoreCase( file.getExtension() ) && !isDisplayPropertiesFile( file.getName() ); }
@Override public boolean handlesFile( IFile file ) { return FILE_EXTENSION.equalsIgnoreCase( file.getExtension() ) && !isDisplayPropertiesFile( file.getName() ); }
@SuppressWarnings( { "UnusedDeclaration" } ) public String getExternalLocationForTesting() { int pos = _packageName.lastIndexOf('.'); String path = _packageName.substring(0, pos).replace('.','/') + "/" + _xmlSchemaSource.getResourceFile().getName(); XmlSchemaDefaultSchemaLocations locations = getDefaultSchemaLocations( getTypeLoader().getModule() ); final List<String> stringList = locations.getExternalLocationsByLocalResourcePath().get(path); if (stringList != null && stringList.size() > 0) { return stringList.get(0); } return null; }
private void addTypeNames( final IDirectory root, IDirectory path, final Set<String> classNames, final String[] fileExts ) { DynamicArray<? extends IFile> iFiles = IDirectoryUtil.allContainedFilesExcludingIgnored(path); for (int i = 0; i < iFiles.size; i++) { IFile file = (IFile) iFiles.data[i]; if (Util.isClassFileName(file.getName(), fileExts)) { String className = getClassNameFromFile(root, file, fileExts); classNames.add(className); } } }
private void addTypeNames( final IDirectory root, IDirectory path, final Set<String> classNames, final String[] fileExts ) { DynamicArray<? extends IFile> iFiles = IDirectoryUtil.allContainedFilesExcludingIgnored(path); for (int i = 0; i < iFiles.size; i++) { IFile file = (IFile) iFiles.data[i]; if (Util.isClassFileName(file.getName(), fileExts)) { String className = getClassNameFromFile(root, file, fileExts); classNames.add(className); } } }
@Override protected Map<String, IFile> init() { List<Pair<String, IFile>> propertiesFiles = _module.getFileRepository().findAllFilesByExtension(EXTENSION); final int initialCapacity = propertiesFiles.size(); Map<String,IFile> result = new HashMap<String, IFile>( initialCapacity ); for (Pair<String,IFile> pair : propertiesFiles) { String fileName = pair.getFirst(); if( !PropertiesTypeLoader.isDisplayPropertiesFile( pair.getSecond().getName() ) ) { String typeName = fileName.substring(0, fileName.length() - EXTENSION.length()).replace('/', '.'); if (isValidTypeName(typeName)) { result.put(typeName, pair.getSecond()); } } } return result; } };
private static void addAllLocalResourceFilesByExtensionInternal(String relativePath, IDirectory dir, String extension, List<Pair<String, IFile>> results) { if (!CommonServices.getPlatformHelper().isPathIgnored(relativePath)) { for (IFile file : dir.listFiles()) { if (file.getName().endsWith(extension)) { String path = appendResourceNameToPath(relativePath, file.getName()); results.add(new Pair<String, IFile>(path, file)); } } for (IDirectory subdir : dir.listDirs()) { String path = appendResourceNameToPath(relativePath, subdir.getName()); addAllLocalResourceFilesByExtensionInternal(path, subdir, extension, results); } } }
private void addAllLocalResourceFilesByExtensionInternal(String relativePath, IDirectory dir, String extension, List<Pair<String, IFile>> results) { List<IDirectory> excludedPath = Arrays.asList(_module.getFileRepository().getExcludedPath()); if ( excludedPath.contains( dir )) { return; } if (!CommonServices.getPlatformHelper().isPathIgnored(relativePath)) { for (IFile file : dir.listFiles()) { if (file.getName().endsWith(extension)) { String path = appendResourceNameToPath(relativePath, file.getName()); results.add(new Pair<String, IFile>(path, file)); } } for (IDirectory subdir : dir.listDirs()) { String path = appendResourceNameToPath(relativePath, subdir.getName()); addAllLocalResourceFilesByExtensionInternal(path, subdir, extension, results); } } }
private void addClassNames(final IDirectory root, IDirectory dir, final ClassPathFilter filter) { for (IFile file : dir.listFiles()) { if( isClassFileName( file.getName() ) ) { String strClassName = getClassNameFromFile( root, file ); if( isValidClassName( strClassName ) ) { putClassName( file, strClassName, filter ); } } } for (IDirectory subDir : dir.listDirs()) { addClassNames(root, subDir, filter); } }
private void addClassNames(final IDirectory root, IDirectory dir, final ClassPathFilter filter) { for (IFile file : dir.listFiles()) { if( isClassFileName( file.getName() ) ) { String strClassName = getClassNameFromFile( root, file ); if( isValidClassName( strClassName ) ) { putClassName( file, strClassName, filter ); } } } for (IDirectory subDir : dir.listDirs()) { addClassNames(root, subDir, filter); } }