diff options
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/KernelBranchesGetter.java')
-rw-r--r-- | plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/KernelBranchesGetter.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/KernelBranchesGetter.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/KernelBranchesGetter.java new file mode 100644 index 0000000..4caea2c --- /dev/null +++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/KernelBranchesGetter.java | |||
@@ -0,0 +1,28 @@ | |||
1 | package org.yocto.sdk.remotetools.wizards.bsp; | ||
2 | |||
3 | /** | ||
4 | * BSPThread that processes the output lines from running command "yocto-bsp list" for the selected kernel | ||
5 | * @author ioana.grigoropol | ||
6 | * | ||
7 | */ | ||
8 | public class KernelBranchesGetter extends BSPThread { | ||
9 | |||
10 | public KernelBranchesGetter(String command) { | ||
11 | super(command); | ||
12 | } | ||
13 | |||
14 | @Override | ||
15 | protected String[] processLine(String line) { | ||
16 | // [TODO : Ioana]: find a better way to identify error lines | ||
17 | if (!line.startsWith("[")) | ||
18 | return new String[]{ERROR, line + "\n"}; | ||
19 | |||
20 | String[] items = line.split(","); | ||
21 | |||
22 | String value = items[0]; | ||
23 | value = value.replace("[\"", ""); | ||
24 | value = value.replaceAll("\"$", ""); | ||
25 | return new String[]{SUCCESS, value}; | ||
26 | } | ||
27 | |||
28 | } | ||