重命名多个文件

@param files 文件数组
@param fileNames 文件名，与文件数组一一对应
320057
public static void renameFiles(File[] files, String[] fileNames) {
        int length = Integer.min(files.length, fileNames.length);
        for (int i = 0; i < length; i++) {
            String fileName = files[i].getParent() + ValueConsts.SEPARATOR + fileNames[i];
            if (!fileName.contains(".")) {
                fileName += files[i].getName().substring(files[i].getName().lastIndexOf("."));
            }
            if (files[i].renameTo(new File(fileName))) {
                logger.info("rename file '" + files[i].getAbsolutePath() + "' to '" + fileName + "'");
            } else {
                logger.info("rename file '" + files[i].getAbsolutePath() + "' error");
            }
        }
    }
359519
public void setInstanceNames(java.util.Collection<String> instanceNames) {
        if (instanceNames == null) {
            this.instanceNames = null;
            return;
        }

        this.instanceNames = new com.amazonaws.internal.SdkInternalList<String>(instanceNames);
    }
1157108
public static void copyFiles(File[] files, String storageFolder) throws IOException {
        storageFolder = checkFolder(storageFolder) + ValueConsts.SEPARATOR;
        for (File file : files) {
            copyFile(file, new File(storageFolder + file.getName()));
        }
    }
19516
private String buildFileName(final String... names) {
        final StringBuilder builder = new StringBuilder();
        for (int i = 0; i < names.length; i++) {
            builder.append(names[i]);
            if (i < names.length - 1) {
                builder.append(SEPARATOR);
            }
        }
        builder.append(".").append("csv");
        return builder.toString();
    }
1058352
public void setDomainNames(java.util.Collection<DomainInfo> domainNames) {
        if (domainNames == null) {
            this.domainNames = null;
            return;
        }

        this.domainNames = new java.util.ArrayList<DomainInfo>(domainNames);
    }
906748
public static void copyFiles(String[] files, String[] destinationFiles) throws IOException {
        copyFiles(getFiles(files), getFiles(destinationFiles));
    }
223859
function(filenames) {
				var isIn = _.some(filenames, function(line) {
					return file.path.indexOf(line) !== -1;
				});
				if (isIn) {
					self.push(file);
				}
				callback();
			}
1013446
public void setAttributeNames(java.util.Collection<String> attributeNames) {
        if (attributeNames == null) {
            this.attributeNames = null;
            return;
        }

        this.attributeNames = new java.util.ArrayList<String>(attributeNames);
    }
42738
public static void configureFiles(Iterable<File> files)
	{
		for (File file : files)
		{
			if (file != null && file.exists() && file.canRead())
			{
				setup(file);
				return;
			}
		}

		System.out.println("(No suitable log config file found)");
	}
934431
def setFilenames( self, filenames ):
        
        mapped = []
        for filename in filenames:
            filename = nativestring(filename)
            if ( not filename ):
                continue
            
            mapped.append(filename)
            if ( len(mapped) == self.maximumLength() ):
                break
        
        self._filenames = mapped
        self.refresh()
222281
void setExistingNames(String... names) {
		this.existingNames = names;
		for (int i = 0; i < this.existingNames.length; ++i) {
			this.existingNames[i] = Strings.nullToEmpty(this.existingNames[i]);
		}
	}
124394
private void load(final String[] subFiles) {
		for (int i = 0; i < subFiles.length; i++) {
			load(subFiles[i]);
		}
	}
109741
public void setFileSystemIds(java.util.Collection<String> fileSystemIds) {
        if (fileSystemIds == null) {
            this.fileSystemIds = null;
            return;
        }

        this.fileSystemIds = new java.util.ArrayList<String>(fileSystemIds);
    }
1280934
public void setConfigRuleNames(java.util.Collection<String> configRuleNames) {
        if (configRuleNames == null) {
            this.configRuleNames = null;
            return;
        }

        this.configRuleNames = new com.amazonaws.internal.SdkInternalList<String>(configRuleNames);
    }
389575
public synchronized void addFile(String filename, String filePath) {
        // fix this to check if duplicate name exists.
        int fileIndex = fileNameList.indexOf(filename);
        if (fileIndex == -1) {
            fileNameList.add(filename);
            filePathList.add(filePath);
        }
    }
492944
def read_files(*filenames):
    
    output = []
    for filename in filenames:
        f = codecs.open(filename, encoding='utf-8')
        try:
            output.append(f.read())
        finally:
            f.close()
    return '\n\n'.join(output)
1327872
public void setDeleteFiles(java.util.Collection<DeleteFileEntry> deleteFiles) {
        if (deleteFiles == null) {
            this.deleteFiles = null;
            return;
        }

        this.deleteFiles = new java.util.ArrayList<DeleteFileEntry>(deleteFiles);
    }