www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,89 @@
|
|||
package it.acxent.face.test;
|
||||
|
||||
import it.acxent.db.ApplParm;
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.face.FotoFace;
|
||||
import it.acxent.face.FotoFaceCR;
|
||||
import it.acxent.util.DbConsole;
|
||||
import it.acxent.util.Timer;
|
||||
import it.acxent.util.Vectumerator;
|
||||
import java.sql.Time;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class SalvaImgFace extends DbConsole {
|
||||
public static void main(String[] args) {
|
||||
SalvaImgFace bean = new SalvaImgFace();
|
||||
bean.doImport();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void doImport() {
|
||||
String db = "face";
|
||||
int i = 0;
|
||||
int se1 = 10;
|
||||
int se2 = 100;
|
||||
String hostname = "localhost:3308";
|
||||
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||
if (!temp.isEmpty())
|
||||
hostname = temp;
|
||||
temp = getCi().readLine("Database name (" + db + "):");
|
||||
if (!temp.isEmpty())
|
||||
db = temp;
|
||||
System.out.println("Db: " + db);
|
||||
ApplParmFull apTarget = new ApplParmFull(new ApplParm(17, "//" + hostname + "/" + db, db, "root", "root", 1, 10, 300));
|
||||
apTarget.setDebug(false);
|
||||
long totNumberOfRecords = 0L;
|
||||
StringBuffer msg = new StringBuffer();
|
||||
try {
|
||||
Timer timer = new Timer();
|
||||
timer.start();
|
||||
FotoFace ff = new FotoFace(apTarget);
|
||||
FotoFaceCR CR = new FotoFaceCR();
|
||||
System.out.println("ciclo foto face");
|
||||
int page = 1;
|
||||
Vectumerator<FotoFace> vec = ff.findAllNoMd5(0, 0);
|
||||
if (page == 1) {
|
||||
totNumberOfRecords = (long)vec.getTotNumberOfRecords();
|
||||
System.out.println("Tot Record: " + totNumberOfRecords);
|
||||
}
|
||||
page++;
|
||||
while (vec.hasMoreElements()) {
|
||||
FotoFace row = (FotoFace)vec.nextElement();
|
||||
if (row.getMd5().isEmpty())
|
||||
row.save();
|
||||
i++;
|
||||
if (se1 > 0 && i % se1 == 0)
|
||||
System.out.print(".");
|
||||
if (se2 > 0 && i % se2 == 0)
|
||||
System.out.println("" + i + " / " + i + " " + totNumberOfRecords);
|
||||
}
|
||||
System.out.println("fine ciclo \n" + msg.toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Time getTimeFromString(String theTime) {
|
||||
try {
|
||||
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||
theTime = theTime.substring(0, 2) + ":" + theTime.substring(0, 2);
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||
int hour = Integer.parseInt(st.nextToken());
|
||||
int min = Integer.parseInt(st.nextToken());
|
||||
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue