Example usage for org.apache.commons.lang StringUtils split

List of usage examples for org.apache.commons.lang StringUtils split

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils split.

Prototype

public static String[] split(String str) 

Source Link

Document

Splits the provided text into an array, using whitespace as the separator.

Usage

From source file:com.google.gdt.eclipse.designer.gxt.model.layout.AnchorDataInfo.java

public String getAnchorHeight() throws Exception {
    String anchor = getAnchor();//from ww w .j  a v  a 2  s  .co  m
    if (anchor != null) {
        String[] anchorParts = StringUtils.split(anchor);
        if (anchorParts.length >= 2) {
            return anchorParts[1];
        }
    }
    return null;
}

From source file:name.milesparker.gerrit.analysis.CollectGit.java

protected static void execOuput(String command, String directory, String outputFile) {
    try {/*from w  w w . j a  v  a2  s .  c o m*/
        Process process = new ProcessBuilder(StringUtils.split(command)).directory(new File(directory))
                .redirectError(Redirect.INHERIT).redirectOutput(new File(outputFile)).start();
        process.waitFor();
    } catch (IOException e) {
        throw new RuntimeException(e);
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.google.gdt.eclipse.designer.gwtext.model.layout.AnchorLayoutDataInfo.java

public void setAnchorWidth(String width) throws Exception {
    Object anchorObject = getAnchor();
    if (anchorObject == Property.UNKNOWN_VALUE) {
        setAnchor(width);/*  w  w w.  ja v a  2  s .  c om*/
    } else {
        String anchor = (String) anchorObject;
        String[] anchorParts = StringUtils.split(anchor);
        if (anchorParts.length == 1) {
            if (anchor.startsWith(" ")) {
                setAnchor(width + " " + anchor.trim());
            } else {
                setAnchor(width);
            }
        } else if (anchorParts.length == 2) {
            setAnchor(width + " " + anchorParts[1]);
        }
    }
}

From source file:com.meidusa.venus.benchmark.FileLineData.java

@Override
public synchronized Object nextData() {
    if (closed)// ww  w  .  ja  v  a2 s .  c  o m
        throw new IllegalStateException("file closed..");
    String line = null;
    try {
        line = raf.readLine();

        while (StringUtil.isEmpty(line) && line != null) {
            line = raf.readLine();
        }

        if (line == null) {
            throw new EOFException("end of File=" + this.getFile().getAbsolutePath());
        }

    } catch (IOException e) {
        closed = true;
        throw new IllegalStateException(e);
    }
    String[] obj = null;
    if (needSplit) {
        if (lineSplit == null) {
            obj = StringUtils.split(line);
        } else {
            obj = StringUtils.split(line, lineSplit);
        }
        return obj;
    } else {
        return line;
    }
}

From source file:barrysw19.calculon.notation.Style12.java

public Style12(String s) {
    List<String> style12 = new ArrayList<>(Arrays.asList(StringUtils.split(s)));
    gameFEN = convertStyle12(style12);/* w  ww.  j av a 2  s. co  m*/

    halfMoveCount = Integer.parseInt(style12.get(15));
    gameNumber = Integer.parseInt(style12.get(16));
    whiteName = style12.get(17);
    blackName = style12.get(18);
    myRelationToGame = Integer.parseInt(style12.get(19));
    timeInitial = Integer.parseInt(style12.get(20));
    timeIncrement = Integer.parseInt(style12.get(21));
    whiteStrength = Integer.parseInt(style12.get(22));
    blackStrength = Integer.parseInt(style12.get(23));
    whiteTime = Integer.parseInt(style12.get(24));
    blackTime = Integer.parseInt(style12.get(25));
    moveNumber = Integer.parseInt(style12.get(26));
    previousMovePGN = style12.get(29);
    sideToPlay = "W".equals(style12.get(9)) ? Piece.WHITE : Piece.BLACK;
}