--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.07.17 at 07:23:49 PM KST
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ociType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ociType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+* <element name="ociOptions" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ociType", propOrder = {
+ "ociOptions"
+})
+public class OciType {
+
+ protected String ociOptions;
+
+ /**
+ * Gets the value of the ociOptions property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getOCIOptions() {
+ return ociOptions;
+ }
+
+ /**
+ * Sets the value of the ociOptions property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setOCIOptions(String value) {
+ this.ociOptions = value;
+ }
+
+}
--- /dev/null
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.emulator.manager.platform;
+
+import java.io.IOException;
+
+
+public class OCI {
+// private int vendorid;
+ private int deviceid;
+ private int listid;
+ private String name;
+
+ public OCI(int i) throws IOException {
+ loadProperty(i);
+ }
+
+ private void loadProperty(int i) throws IOException {
+ // this.vendorid = 1;
+ //this.deviceid = 1;
+ //this.name = "USB Storage";
+ this.listid = i;
+ this.deviceid = i+1;
+ this.name = "USB Storage" + i;
+
+ // load OCI device list
+ /*
+ this.path = path.getCanonicalPath();
+ File f = new File(path + File.separator + StringResources.SKIN_INFO_FILENAME);
+ FileInputStream inputStream = null;
+ try {
+ if (f.exists()) {
+ inputStream = new FileInputStream(f);
+ Properties prop = new Properties();
+ prop.load(inputStream);
+ device_name = prop.getProperty(StringResources.SKIN_NAME);
+ } else {
+ throw new IOException(StringResources.SKIN_INFO_FILENAME + " file does not exist.");
+ }
+ } finally {
+ // clear
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ EMLogger.getLogger().log(Level.WARNING, e.getMessage());
+ }
+ }
+ }
+ */
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getDeviceid() {
+ return deviceid;
+ }
+
+ public void setDeviceid(int id) {
+ this.deviceid = id;
+ }
+
+ public int getListid() {
+ return listid;
+ }
+
+ public void setListid(int id) {
+ this.listid = id;
+ }
+
+ @ Override
+ public String toString() {
+ return name;
+ }
+
+ @ Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof OCI)) {
+ return false;
+ }
+
+ if (((OCI)obj).getName().equals(name)) {
+ return true;
+ }
+
+ return false;
+ }
+}
--- /dev/null
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.emulator.manager.platform;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.resources.StringResources;
+
+
+public class OCIList {
+
+ private ArrayList<OCI> OCIDeviceList = new ArrayList<OCI>();
+ private ArrayList<OCI> OCISelectDeviceList = new ArrayList<OCI>();
+ //private Skins defaultSkin = null;
+
+ private static OCIList instance = null;
+ static {
+ instance = new OCIList();
+ }
+
+ public static OCIList getInstance() {
+ return instance;
+ }
+
+ private OCIList() {
+
+ /*try {
+ for (Platform platform : EmulatorManager.getPlatformList()) {
+ makeOCIList(new File(FilePathResources.getPlatformsPath() + File.separator + platform.getName() + FilePathResources.getDefaultSkinPath()));
+ }
+ makeOCIList(new File(FilePathResources.getSkinPath()));
+
+ //defaultSkin = skinsList.get(0);
+ } catch (IOException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+
+ try {
+ makeOCIList();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ }
+
+ private void makeOCIList() throws IOException {
+ /*System.out.println("oci dir : " + dir.getPath());
+ if (dir.exists()) {
+ for (File OCI : dir.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ System.out.println("pathname : " + pathname.getName());
+ if (!pathname.isDirectory()) {
+ return false;
+ }
+ return true;
+ }
+ })) {
+ OCI s = null;
+ try {
+ s = new OCI();
+ } catch(IOException e) {
+ EMLogger.getLogger().warning("Failed adding Skin.."
+ + StringResources.NEW_LINE + "Skin Path: " + OCI.getAbsolutePath()
+ + StringResources.NEW_LINE + "Error: " + e.getMessage());
+ continue;
+ }
+ OCIList.add(s);
+ }
+
+ } else {
+ throw new IOException("This Skin path does not exist (" + dir.getPath() + ")");
+ }*/
+ for (int i = 0; i < 10; i++) {
+ OCI s = null;
+ try {
+ s = new OCI(i);
+ } catch(IOException e) {
+ EMLogger.getLogger().warning("Failed adding OCI Device.."
+ + StringResources.NEW_LINE + "Error: " + e.getMessage());
+
+ }
+ OCIDeviceList.add(s);
+ }
+ }
+
+ public ArrayList<OCI> getOCISelectList() {
+ return OCISelectDeviceList;
+ }
+
+ public ArrayList<OCI> getOCIList() {
+ return OCIDeviceList;
+ }
+
+ public String setOCISelectList(String ociOptions) {
+ if (ociOptions == null)
+ return ociOptions;
+ StringTokenizer s = new StringTokenizer(ociOptions);
+ String devicename;
+ OCI device;
+ while (s.hasMoreTokens()) {
+ devicename = s.nextToken("|");
+ device = findOCIDeviceName(devicename);
+ OCISelectDeviceList.add(device);
+ }
+ return ociOptions;
+ }
+
+ public boolean find(String name, String ociOptions) {
+ if (ociOptions.matches(".*"+name+".*"))
+ return true;
+ return false;
+ }
+
+ public OCI findOCIUsePath(String path) {
+ if (OCIDeviceList != null) {
+ /*
+ for (OCI OCI : OCIDeviceList) {
+ }
+ */
+ }
+ return null;
+ }
+
+ public OCI findOCIDeviceName(String name) {
+ if (OCIDeviceList != null) {
+ for (OCI OCI : OCIDeviceList) {
+ if (OCI.getName().equals(name)) {
+ return OCI;
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean findOCISelectDiviceName(String name) {
+ if (OCISelectDeviceList != null) {
+ for (OCI OCI : OCISelectDeviceList) {
+
+ if (OCI.getName().equals(name)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public ArrayList<OCI> findOCIList() {
+ if (OCIDeviceList != null) {
+ for (OCI OCI : OCIDeviceList) {
+ // selected OCI divece add
+ System.out.println("OCI " + OCI.getName());
+
+ }
+ }
+ return OCISelectDeviceList;
+ }
+
+ public String addOciDeviceSelectName() {
+ String addOciDeviceName = "";
+
+ if (OCISelectDeviceList != null) {
+ for (OCI OCI : OCISelectDeviceList) {
+ addOciDeviceName += (OCI.getName() + " | ") ;
+ }
+ }
+ return addOciDeviceName;
+ }
+
+ public String deleteOciDeviceSelectName(String name) {
+ String deleteOciDeviceName = "";
+
+ if (OCISelectDeviceList != null) {
+ for (OCI OCI : OCISelectDeviceList) {
+ if (OCI.getName().equals(name)) {
+ OCISelectDeviceList.remove(OCI);
+ }
+
+ }
+ }
+ return deleteOciDeviceName;
+ }
+}
+