Examples of readNext()


Examples of au.com.bytecode.opencsv.CSVReader.readNext()

        reader = csv.reader();
       
        int nameIndex = csv.getHeader("name");
        Coordinate worldLocation = new Coordinate();
        String [] row;
        while ((row = reader.readNext()) != null) {
            Point point = csv.getPoint(row);
            Coordinate dataLocation = point.getCoordinate();
            try {
                JTS.transform(dataLocation, worldLocation, dataToWorld);
            } catch (TransformException e) {
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

    protected void testRawCsvRead(String originalCommentText)
            throws FileNotFoundException, IOException {
        CSVReader reader = new CSVReader(new FileReader(filePath));
        String[] nextLine = null;
        int count = 0;
        while ((nextLine = reader.readNext()) != null) {
            if (!nextLine[0].equals("field1")) {
                System.out.println("RawCsvRead Assert Error: Name is wrong.");
            }
            if (!nextLine[1].equals("3.0")) {
                System.out.println("RawCsvRead Assert Error: Value is wrong.");
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

    private List<String[]> readLines(String csvContent) throws IOException  {
        CSVReader reader = new CSVReader(new StringReader(csvContent));
       
        List<String[]> result = new ArrayList<String[]>();
        String [] nextLine;
        while ((nextLine = reader.readNext()) != null) {
            result.add(nextLine);
        }
        return result;
    }
}
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

                return;
            }
            String csvSeparator = jParams.getParameter("csvSeparator");
            CSVReader csvReader = new CSVReader(new InputStreamReader(fileItem.getInputStream()), csvSeparator.charAt(0));
            // the first line contains the column names;
            String[] headerElements = csvReader.readNext();
            List<String> headerElementList = Arrays.asList(headerElements);
            int userNamePos = headerElementList.indexOf("j:nodename");
            int passwordPos = headerElementList.indexOf("j:password");
            if ((userNamePos < 0) || (passwordPos < 0)) {
                logger.error("Couldn't find user name or password column in CSV file, aborting batch creation !");
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

            int errorsCreatingUsers = 0;
            int usersCreatedSuccessfully = 0;
            JahiaPasswordPolicyService pwdPolicyService = ServicesRegistry.getInstance().getJahiaPasswordPolicyService();
            JahiaUserManagerService userService = ServicesRegistry.getInstance().getJahiaUserManagerService();
           
            while ((lineElements = csvReader.readNext()) != null) {
                List<String> lineElementList = Arrays.asList(lineElements);
                Properties properties = buildProperties(headerElementList, lineElementList);
                String userName = lineElementList.get(userNamePos);
                String password = lineElementList.get(passwordPos);
                if (userService.isUsernameSyntaxCorrect(userName)) {
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

        CSVReader reader = null;
        try {
            is = new BufferedInputStream(new FileInputStream(subscribersCSVFile));
            char separator = ',';
            reader = new CSVReader(new InputStreamReader(is, "UTF-8"), separator);
            String[] columns = reader.readNext();
            if (columns == null) {
                logger.warn("No data for importing subscriptions is found" + " or the file is not well-formed");
                return;
            }
            if (columns.length == 1 && columns[0].contains(";")) {
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

                reader.close();
                IOUtils.closeQuietly(is);
                is = new BufferedInputStream(new FileInputStream(subscribersCSVFile));
                separator = ';';
                reader = new CSVReader(new InputStreamReader(is, "UTF-8"), separator);
                columns = reader.readNext();
            }
            int usernamePosition = ArrayUtils.indexOf(columns, "j:nodename");
            int emailPosition = ArrayUtils.indexOf(columns, J_EMAIL);
            if (usernamePosition == -1 && emailPosition == -1) {
                logger.warn("No data for importing subscriptions is found" + " or the file is not well-formed");
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

                logger.warn("No data for importing subscriptions is found" + " or the file is not well-formed");
                return;
            }
            Map<String, Map<String, Object>> subscribers = new HashMap<String, Map<String, Object>>();
            String[] nextLine;
            while ((nextLine = reader.readNext()) != null) {
                String username = usernamePosition != -1 ? nextLine[usernamePosition] : null;
                String email = emailPosition != -1 ? nextLine[emailPosition] : null;
                boolean registered = true;
                if (StringUtils.isNotEmpty(username)) {
                    // registered Jahia user is provided
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

    public void addUserList(UserStoreManager userStore) throws UserAdminException {
        try {
            CSVReader csvReader = new CSVReader(reader, ',', '"', 1);
            String password = config.getDefaultPassword();
            String[] line = csvReader.readNext();
            boolean isDuplicate = false;
            while (line != null && line.length > 0) {
                String userName = line[0];
                if (!userStore.isExistingUser(userName)) {
                    userStore.addUser(userName, password, null, null, null, true);
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVReader.readNext()

                if (!userStore.isExistingUser(userName)) {
                    userStore.addUser(userName, password, null, null, null, true);
                } else {
                    isDuplicate = true;
                }
                line = csvReader.readNext();
            }
           
            if (isDuplicate == true) {
                throw new UserAdminException(
                        "Detected duplicate usernames. Failed to import duplicate users. Non-duplicate user names were successfually imported.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.