1 package org.kuali.common.util.execute;
2
3 import java.io.File;
4 import java.util.List;
5
6 import org.kuali.common.util.CollectionUtils;
7 import org.kuali.common.util.LocationUtils;
8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory;
10
11 public class CopyLocationsToDirectoryExecutable extends AbstractCopyLocationsExecutable {
12
13 private static final Logger logger = LoggerFactory.getLogger(CopyLocationsToDirectoryExecutable.class);
14
15 boolean addSequenceToFilenames = true;
16 int initialSequenceNumber = 1;
17
18 @Override
19 protected List<File> getFiles(List<String> locations) {
20 List<String> filenames = LocationUtils.getFilenames(locations);
21 if (addSequenceToFilenames) {
22 logger.debug("Adding sequences");
23 filenames = CollectionUtils.getSequencedStrings(filenames, initialSequenceNumber);
24 }
25 return LocationUtils.getFiles(directory, filenames);
26 }
27
28 public boolean isAddSequenceToFilenames() {
29 return addSequenceToFilenames;
30 }
31
32 public void setAddSequenceToFilenames(boolean addSequenceToFilenames) {
33 this.addSequenceToFilenames = addSequenceToFilenames;
34 }
35
36 public int getInitialSequenceNumber() {
37 return initialSequenceNumber;
38 }
39
40 public void setInitialSequenceNumber(int initialSequenceNumber) {
41 this.initialSequenceNumber = initialSequenceNumber;
42 }
43
44 }