CropAssetCopyTool

This commit is contained in:
gexce
2017-08-17 13:01:14 +02:00
parent 3c18cb1418
commit 31e365af05
4 changed files with 171 additions and 8 deletions
@@ -22,12 +22,12 @@ public class ToolboxFileExporter {
private List<String[]> rows;
private String baseDir = "F:\\Toolbox\\Assets";
private String baseDir = "D:\\Toolbox\\Assets";
// Formatdatei generiert mit
// bcp "SELECT OriginalImage FROM AssetImages WHERE AssetID=586" queryout Image.jpg -S MOVNCG -d Bayertoolbox_prod -T
// Geben Sie den Dateispeichertyp des Felds OriginalImage ein [varbinary(max)]: x
// Geben Sie die Präfixlänge des OriginalImage-Felds ein [8]: 0
// Geben Sie die Prfixlnge des OriginalImage-Felds ein [8]: 0
// Geben Sie das Feldabschlusszeichen ein [none]:
// Abruf:
@@ -35,7 +35,7 @@ public class ToolboxFileExporter {
private String command1 = "bcp \"SELECT OriginalImage FROM AssetImages WHERE AssetID=";
private String command2 = "\" queryout \"";
private String command3 = "\" -S MOVNCG -d Bayertoolbox_prod -T -f \"F:\\Toolbox\\bcp.fmt\" -a 16384";
private String command3 = "\" -S MOVNCG -d Bayertoolbox_prod -T -f \"D:\\Toolbox\\bcp.fmt\" -a 16384";
private File workingDir = new File(baseDir);
@@ -43,7 +43,7 @@ public class ToolboxFileExporter {
readList();
for (String[] row : rows) {
getImage(row[1], row[3]);
getImage(row[0], row[1]);
}
}
@@ -75,15 +75,15 @@ public class ToolboxFileExporter {
CsvParser parser = new CsvParser(settings);
rows = parser.parseAll(new File("F:\\Toolbox\\AssetImages.csv"));
rows = parser.parseAll(new File("C:\\Temp\\Migration CS - SQL Server\\export-2017-08-15.csv"));
}
public static void main(String[] args) {
try {
Layout layout = new PatternLayout("%p %m%n"); // "%d{ISO8601} - %p %m%n"
Layout layout = new PatternLayout("%d{ISO8601} - %p %m%n"); // "%d{ISO8601} - %p %m%n"
BasicConfigurator.configure(new ConsoleAppender(layout));
BasicConfigurator.configure(new RollingFileAppender(layout, "F:\\Toolbox\\download.log", true));
BasicConfigurator.configure(new RollingFileAppender(layout, "D:\\Toolbox\\download.log", true));
log.setLevel(Level.DEBUG);
long startTime = System.currentTimeMillis();