DirectorySnapshot( String path, FileSystemEqualityState equality ) { this.path = IoUtils.normalizeUnixDir(path.trim()); this.equality = equality; }
DirectorySnapshot( String path, FileMatchersContainer matchersContainer, FileSystemEqualityState equality ) { this.path = IoUtils.normalizeUnixDir(path.trim()); this.equality = equality; if (matchersContainer != null) { this.matchersContainer = matchersContainer; } }
DirectorySnapshot( String path, Map<String, FindRules> fileRules, FileSystemEqualityState equality ) { this.path = IoUtils.normalizeUnixDir(path.trim()); this.equality = equality; this.matchersContainer.addFileAttributesMap(fileRules); }
private String parseDirectoryPath( String directoryPath, boolean lastTokenIsRegex ) { if (StringUtils.isNullOrEmpty(directoryPath)) { throw new FileSystemSnapshotException("Invalid directory path '" + directoryPath + "'"); } if (lastTokenIsRegex) { int lastFileSeparatorCharIdx = directoryPath.lastIndexOf(File.separator) + 1; // lastFileSeparatorCharIdx is -1 if File.separator is not found, but by adding 1, it will be 0 // That's why the next check is against 0 and not -1 if (lastFileSeparatorCharIdx == 0) { return directoryPath; } String lastToken = directoryPath.substring(lastFileSeparatorCharIdx); directoryPath = IoUtils.normalizeUnixDir(directoryPath.substring(0, directoryPath.lastIndexOf(lastToken)) .trim()); return directoryPath + lastToken; } else { return IoUtils.normalizeUnixDir(directoryPath.trim()); } }
boolean skipSubDir = false; String unixDirName = IoUtils.normalizeUnixDir(fsEntity.getName()); // skipped dirs are also in UnixDir (ends with '/') format Iterator<Map<String, Boolean>> it = skippedSubDirs.iterator(); while (it.hasNext()) {
mapFileDocument = mapFile; } else { mapFileDocument = IoUtils.normalizeUnixDir(UiEngineConfigurator.getInstance() .getMapFilesBaseDir()) + mapFile;
this.sftpPath = IoUtils.normalizeUnixFile(this.sftpPath); } else { this.sftpPath = IoUtils.normalizeUnixDir(this.sftpPath);
destDir = IoUtils.normalizeUnixDir(destDir);
/** * Create remote directories * * @param dirPath the directory path */ public void makeRemoteDirectories( String dirPath ) { if (isVerbose) { log.debug("Create remote directory " + dirPath); } try { if (!isRemoteFileOrDirectoryExisting(dirPath)) { dirPath = IoUtils.normalizeUnixDir(dirPath); int dirSeparatorIndex = 0; while ( (dirSeparatorIndex = dirPath.indexOf('/', dirSeparatorIndex + 1)) > 0) { String currentDirPath = dirPath.substring(0, dirSeparatorIndex); if (!isRemoteFileOrDirectoryExisting(currentDirPath)) { channel.mkdir(currentDirPath); } } } } catch (Exception e) { throw new JschSftpClientException(e.getMessage(), e); } }
String absolutePath = new String(IoUtils.normalizeUnixDir(path) + fileName).replace("//", "/"); if (line.startsWith("l") && line.contains("->")) { // a link
this.isUnix = this.home.charAt(0) == '/'; if (this.isUnix) { sftpHome = IoUtils.normalizeUnixDir(home); } else { sftpHome = IoUtils.normalizeUnixDir(home.substring(home.indexOf(':') + 1));
iOSUserHomeDir = "/" + iOSUserHomeDir; iOSUserHomeDir = IoUtils.normalizeUnixDir(iOSUserHomeDir);
&& !preservedPaths.contains(IoUtils.normalizeUnixDir(fileEntry.getPath())))) { // skip preserved directories
private FileEntry getFileEntry( LsEntry lsEntry, String parentPath ) { FileEntry fileEntry = new FileEntry(lsEntry.getFilename(), IoUtils.normalizeUnixDir(parentPath) + lsEntry.getFilename(), lsEntry.getAttrs().isDir()); fileEntry.setSize(lsEntry.getAttrs().getSize()); fileEntry.setParentPath(parentPath); fileEntry.setLastModificationTime(lsEntry.getAttrs().getMTime()); return fileEntry; }