java/dbloader/src/main/java/be/bosa/dt/best/dbloader/Main.java
/**
	 * Export data to CSV file
	 * 
	 * @param csvstr
	 * @param xmlPath path of BeST XML files
	 * @param gps
	 * @return true upon success
	 */
Export data to CSV file

@param csvstr
@param xmlPath path of BeST XML files
@param gps
@return true upon success
Export data to CSV file @param csvstr @param xmlPath path of BeST XML files @param gps @return true upon success
private static boolean writeCSV(String csvstr, Path xmlPath, boolean gps) {
		CsvPreparer w = null;
		try {
			w = new CsvPreparer();
		} catch (Exception ex) {
			LOG.severe("Database loader count not be initialized");
			return false;
		}
		Path p = Paths.get(csvstr);
		if (!p.toFile().exists() && !p.toFile().mkdirs()) {
			LOG.severe("Output directory does not exist and could not be created");
			return false;
		}
		try {
			w.write(xmlPath, p, gps);
		} catch (IOException e) {
			LOG.log(Level.SEVERE, "Failed", e);
			return false;
		}
		return true;
	}
private static boolean writeCSV ( String csvstr , Path xmlPath , boolean gps ) { CsvPreparer w = null ; try { w = new CsvPreparer ( ) ; } catch ( Exception ex ) { LOG . severe ( "Database loader count not be initialized" ) ; return false ; } Path p = Paths . get ( csvstr ) ; if ( ! p . toFile ( ) . exists ( ) && ! p . toFile ( ) . mkdirs ( ) ) { LOG . severe ( "Output directory does not exist and could not be created" ) ; return false ; } try { w . write ( xmlPath , p , gps ) ; } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed" , e ) ; return false ; } return true ; }
Export data to CSV file
Export data to CSV file