import org.eclipse.debug.ui.actions.LaunchAction;
import org.tizen.common.gom.launch.GomLaunchData;
-public class GomSmartLaunchAction extends LaunchAction{
+public class GomSmartLaunchAction extends LaunchAction {
public GomSmartLaunchAction(GomLaunchData data) {
super(data.getLaunchConfiguration(), data.getMode());
this.setText(data.getDataInfo());
this.setToolTipText(data.toString());
}
-
}
}
return sb.toString();
}
- public static String asString(InputStream is) throws IOException{
+
+ public static String asString(InputStream is) throws IOException {
StringBuffer out = new StringBuffer();
byte[] b = new byte[4096];
- for (int n; (n = is.read(b)) != -1;)
- {
+ for (int n; (n = is.read(b)) != -1;) {
out.append(new String(b,0,n));
}
return out.toString();
}
}
-
protected void loadCertificate( final String location ) throws KeyStoreException, ComplicatedCertificationException {
final Certificate cert = keyStore.getCertificate(privateKeyAlias);
if (cert instanceof X509Certificate) {
}
}
-
- protected void loadCertificateChain() throws CertificationException{
+ protected void loadCertificateChain() throws CertificationException {
certificationChain = new ArrayList<X509Certificate>();
try {
Certificate[] chain = keyStore.getCertificateChain( privateKeyAlias );
signer.sign( false );
}
- public static void authorSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception{
+ public static void authorSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception {
checkNullParameters(targetDir, authorP12Path, authorPass);
// HashingSigning.AuthorSignature(targetDir, authorP12Path, authorPass, authorCAPath, null);
signer.sign( item, SigningProfile.AUTHOR_ORDINAL, new File( targetDir, signatureName ), false );
}
- public static void distSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception{
+ public static void distSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception {
checkNullParameters(targetDir, distP12Path, distPass);
// HashingSigning.DistributorSignature(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber);
signer.sign( item, distNumber, new File( targetDir, signatureName ), false );
}
- public static void authorIncrementalSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception{
+ public static void authorIncrementalSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception {
checkNullParameters(targetDir, authorP12Path, authorPass);
// HashingSigning.AuthorSignatureRDS(targetDir, authorP12Path, authorPass, authorCAPath, null);
signer.sign( item, SigningProfile.AUTHOR_ORDINAL, new File( targetDir, signatureName ), true );
}
- public static void distIncrementalSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception{
+ public static void distIncrementalSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception {
checkNullParameters(targetDir, distP12Path, distPass);
// HashingSigning.DistributorSignatureRDS(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber);
signer.sign( item, distNumber, new File( targetDir, signatureName ), true );
}
- private static void checkNullParameters(String targetDir, String p12Path, String pass) throws IllegalArgumentException{
+ private static void checkNullParameters(String targetDir, String p12Path, String pass) throws IllegalArgumentException {
String emptyParameter = null;
if(StringUtil.isEmpty(targetDir)) {
emptyParameter = "target directory";
throw new IllegalArgumentException(emptyParameter + " is empty");
}
- public static void dist2SignWithParameterCheck(String targetDir, String dist2P12Path, String dist2Pass, String dist2CAPath, String dist2RootPath) throws Exception{
+ public static void dist2SignWithParameterCheck(String targetDir, String dist2P12Path, String dist2Pass, String dist2CAPath, String dist2RootPath) throws Exception {
if(!StringUtil.isEmpty(dist2P12Path) && !StringUtil.isEmpty(dist2Pass)) {
if(StringUtil.isEmpty(dist2CAPath) || StringUtil.isEmpty(dist2RootPath)) {
dist2CAPath = null;
}
}
- public static void dist2IncrementalSignWithParameterCheck(String targetDir, String dist2P12Path, String dist2Pass, String dist2CAPath, String dist2RootPath) throws Exception{
+ public static void dist2IncrementalSignWithParameterCheck(String targetDir, String dist2P12Path, String dist2Pass, String dist2CAPath, String dist2RootPath) throws Exception {
if(!StringUtil.isEmpty(dist2P12Path) && !StringUtil.isEmpty(dist2Pass)) {
if(StringUtil.isEmpty(dist2CAPath) || StringUtil.isEmpty(dist2RootPath)) {
dist2CAPath = null;
pattern="org\.eclipse\.wst\.xml\.ui/org\.eclipse\.wst\.xml\.ui\.XMLExampleProjectCreationWizard">\r
</activityPatternBinding>\r
\r
-\r
<activityPatternBinding\r
activityId="org.tizen.web.DisableWizardsActivity"\r
pattern="org\.eclipse\.emf\.ecore\.editor/org\.eclipse\.emf\.ecore\.presentation\.EcoreModelWizardID">\r
pattern="org\.eclipse\.jdt\.ui/org\.eclipse\.jdt\.ui\.wizards.*">\r
</activityPatternBinding>\r
\r
-\r
<activityPatternBinding\r
activityId="org.tizen.web.DisableWizardsActivity"\r
pattern="org\.eclipse\.jdt\.junit/org\.eclipse\.jdt\.junit\.wizards.*">\r
category="org.tizen.common.properties.tizen"\r
class="org.tizen.common.rds.ui.preference.RdsPreferencePage"\r
id="org.tizen.common.properties.rds"\r
- name="%RDS.name">\r
+ name="%org.tizen.common.preferences.rds.name">\r
<enabledWhen>\r
<adapt\r
type="org.eclipse.core.resources.IProject">\r
</page>\r
</extension>\r
<!-- activities end -->\r
+\r
+ <!-- RDS Marker -->\r
+ <extension\r
+ id="org.tizen.common.launch.rdsMarker"\r
+ name="RDS Problem"\r
+ point="org.eclipse.core.resources.markers">\r
+ <persistent\r
+ value="false">\r
+ </persistent>\r
+ <super\r
+ type="org.eclipse.core.resources.problemmarker">\r
+ </super>\r
+ </extension>\r
</plugin>
private static Logger logger = LoggerFactory.getLogger(DirectoryCopyHandlingCommand.class);
- public DirectoryCopyHandlingCommand(List<String> sourcePathList, List<String> targetPathList) throws IllegalArgumentException{
+ public DirectoryCopyHandlingCommand(List<String> sourcePathList, List<String> targetPathList) throws IllegalArgumentException {
if(sourcePathList.size() != targetPathList.size()) {
throw new IllegalArgumentException("Lenghs of sourcePathList and target paths are not same");
}
package org.tizen.common.core.command.prompter;
-public abstract class RunnableOption extends ChoiceOption{
+public abstract class RunnableOption extends ChoiceOption {
/**
* Arguments which will be used in run.
import org.tizen.sdblib.IDevice;
-public interface ITizenNativeLaunchConfiguration extends ITizenLaunchConfiguration{
+public interface ITizenNativeLaunchConfiguration extends ITizenLaunchConfiguration {
public IDevice getDeviceFromLaunchConfiguration(IDevice[] devices);
}
* @author hyunsik
*
*/
-public interface ITizenWebLaunchConfiguration extends ITizenLaunchConfiguration{
+public interface ITizenWebLaunchConfiguration extends ITizenLaunchConfiguration {
}
}
Workspace workspace = ((Workspace)project.getWorkspace());
ElementTreeReader treeReader = new ElementTreeReader(workspace.getSaveManager());
-
DataInputStream input = null;
try {
input = new DataInputStream(new SafeFileInputStream(strLocalFile, strLocalFile + ".temp", TREE_BUFFER_SIZE));
* @return String
*/
private String downloadOldTree( ) {
- String strLocalFile = null;
-
if ( remotePath == null ) {
return null;
}
String deltaFileOnRemote = remotePath + STR_TREE_DIRECTORY + STR_TREE_FILE;
- strLocalFile = project.getLocation().toString();
+ String strLocalFile = project.getLocation().toString();
try {
SyncResult result = device.getSyncService().pull(device.getFileEntry( deltaFileOnRemote ), strLocalFile);
if ( !result.isOk() ) {
}
IResourceDelta result = ResourceDeltaFactory.computeDelta((Workspace) project.getWorkspace(), oldTree, tree, project.getFullPath(), -1);
-
return getDelta(new ArrayList<DeltaResourceInfo>(), result, projectPath);
}
}
private DeltaResourceInfo addDeltaInfo(List<DeltaResourceInfo> deltaInfoList, String nodeName, String deltaFullPath, String deltaType, int resourceType) {
- DeltaResourceInfo resourceInfo = null;
-
- resourceInfo = new DeltaResourceInfo(nodeName, deltaFullPath, deltaType, resourceType);
+ DeltaResourceInfo resourceInfo = new DeltaResourceInfo(nodeName, deltaFullPath, deltaType, resourceType);
deltaInfoList.add(resourceInfo);
-
return resourceInfo;
}
}
ElementTreeWriter treeWriter = new ElementTreeWriter(workspace.getSaveManager());
-
String strLocalFile = project.getLocation().toString() + "/" + STR_TREE_FILE;
-
DataOutputStream output = null;
try {
output = new DataOutputStream(new SafeFileOutputStream(strLocalFile, strLocalFile + ".temp"));
-
treeWriter.writeTree(tree, subTreePath, ElementTreeWriter.D_INFINITE, output);
} catch (IOException e) {
return "";
try {
project.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor());
} catch (CoreException e) {
- logger.error("Could not refresh project resources...", e);
+ logger.error("Failed to refresh project resources", e);
}
}
return strLocalFile;
public void addAddDelta(String addDelta) {
addList.add(addDelta);
}
+
public void addModifyDelta(String addDelta) {
modifyList.add(addDelta);
}
+
public void addDeleteDelta(String addDelta) {
deleteList.add(addDelta);
}
-
/**
* Makes delta list file.
* If addList and modifyList and deleteList are empty, This method does not make delta list file and returns null.
}
return null;
}
-
return file;
}
-
-
}
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.tizen.sdblib.service.SyncService;
/**
- * This class deploys delta resource of project to target.
+ * Deploys delta resources of project to target.
*
* @author Gun Kim<gune.kim@samsung.com>
*/
public abstract class RdsDeployer implements Closeable {
private final Logger logger = LoggerFactory.getLogger(RdsDeployer.class);
+ private static final String RDS_MARKER = "org.tizen.common.launch.rdsMarker";
+
protected IProgressMonitor monitor;
protected ITizenConsoleManager console;
protected String pkgType;
protected IDevice device;
protected RdsDeltaDetector deltaDetector;
protected ISdbCommandHelper tizenCommand;
- // ignoreList has a high priority better than interestList
+ // ignoreList has a high priority better than interestList.
protected List<DeltaResourceInfo> ignoreList = new ArrayList<DeltaResourceInfo>();
protected List<DeltaResourceInfo> interestList = new ArrayList<DeltaResourceInfo>();
private SyncService syncService;
-// private final static String[] needAppOwnerArray = new String[] {"/data", "/shared/data", "/shared/trusted", "/setting"};
+ //private final static String[] needAppOwnerArray = new String[] {"/data", "/shared/data", "/shared/trusted", "/setting"};
// deltaInfoList should be set only once.
private List<DeltaResourceInfo> deltaInfoList = null;
// strDeltaInfoFile should be set when deltaInfoList is set.
*
* @return If this method returns false, {@link RdsDeployer#deploy()} fails and returns false.
*/
- protected abstract boolean sign( List<DeltaResourceInfo> deltaInfoList) throws CoreException, IOException, IllegalStateException;
+ protected abstract boolean sign(List<DeltaResourceInfo> deltaInfoList) throws CoreException, IOException, IllegalStateException;
- public RdsDeployer( IProject project, IDevice device, ISdbCommandHelper tizenCommand, ITizenConsoleManager console, String pkgType, IProgressMonitor monitor) {
+ public RdsDeployer(IProject project, IDevice device, ISdbCommandHelper tizenCommand, ITizenConsoleManager console, String pkgType, IProgressMonitor monitor) {
this.project = project;
this.device = device;
this.tizenCommand = tizenCommand;
* @return If this method returns false, {@link RdsDeployer#deploy()} doesn't execute and returns false.
*/
protected boolean preDeploy() throws CoreException {
+ project.deleteMarkers(RDS_MARKER, true, IResource.DEPTH_INFINITE);
+ if ( !hasOldResourceInfo() ) {
+ logger.debug(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_FIND_RDS_INFO));
+ return false;
+ }
return true;
}
return true;
}
- final String failToSignMsg = "failed to sign for RDS";
+ final String failToSignMsg = "Failed to sign for RDS";
try {
if ( !sign(deltaInfoList) ) {
printInfo(failToSignMsg);
return false;
}
- if ( deltaInfoList.isEmpty()) {
+ if ( deltaInfoList.isEmpty() ) {
return true;
}
try {
partialInstall(deltaInfoList);
- }
- catch ( CoreException e ) {
+ } catch (CoreException e) {
logger.error(RdsMessages.CANNOT_PARTIALLY_INSTALL, e);
printInfo(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_PARTIALLY_INSTALL));
+ reportWarning(project, e.getMessage(), false);
return false;
}
return true;
}
+ protected void reportWarning(IResource resource, String msg, boolean persistent) {
+ IMarker m;
+ try {
+ m = resource.createMarker(RDS_MARKER);
+ m.setAttribute(IMarker.MESSAGE, msg);
+ m.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ m.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ m.setAttribute(IMarker.TRANSIENT, !persistent);
+ } catch (CoreException e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
/**
* Returns a delta list interested.
*/
if ( deltaInfoList == null ) {
newCoreException(RdsMessages.CANNOT_FIND_DELTA, null);
}
-
deltaInfoList = getInterestDelta(deltaInfoList);
} catch (CoreException e) {
printInfo(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_FIND_DELTA));
return null;
}
-
return deltaInfoList;
}
- public void setInterestList( List<DeltaResourceInfo> list) {
+ public void setInterestList(List<DeltaResourceInfo> list) {
interestList = list;
}
- public void setIgnoreList( List<DeltaResourceInfo> list) {
+ public void setIgnoreList(List<DeltaResourceInfo> list) {
ignoreList = list;
}
}
// If the file does not exist, a type of delta is DeltaResourceInfo.TYPE_DELETE
else {
- interestFullPath = interest.getFullPath().substring(0,interest.getFullPath().length()-1 );
- interestRemotePath = interest.getRemotePath().substring(0,interest.getRemotePath().length()-1 );
+ interestFullPath = interest.getFullPath().substring(0, interest.getFullPath().length()-1 );
+ interestRemotePath = interest.getRemotePath().substring(0, interest.getRemotePath().length()-1 );
}
}
else {
interestFullPath = interest.getFullPath();
interestRemotePath = interest.getRemotePath();
}
-
prefix = strProjectPath + interestFullPath;
strRemotePath = convertToRemotePath(delta.getFullPath(), prefix, interestRemotePath);
}
if ( strRemotePath == null ) {
- logger.error(String.format("Cannot make remotePath (host: %s, prefix: %s)", delta.getFullPath(), prefix) );
+ logger.error(String.format("Cannot make remotePath (host: %s, prefix: %s)", delta.getFullPath(), prefix));
newCoreException(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_FIND_DELTA), null);
}
- if ( IResource.FOLDER == delta.getResourceType() && !DeltaResourceInfo.TYPE_DELETE.equals(delta.getType())) {
+ if ( IResource.FOLDER == delta.getResourceType() && !DeltaResourceInfo.TYPE_DELETE.equals(delta.getType()) ) {
if ( !strRemotePath.endsWith("/") ) {
strRemotePath = strRemotePath + "/";
}
/**
* Replaces {@code prefix} of {@code hostPath} to the {@code replacement}.<br>
* If the {@code hostPath} doesn't start the {@code prefix}, returns null.
- *
*/
- private String convertToRemotePath( String hostPath, String prefix, String replacement) {
+ private String convertToRemotePath(String hostPath, String prefix, String replacement) {
String result = null;
-
if ( hostPath.startsWith(prefix) ) {
- result = replacement + hostPath.substring( prefix.length(), hostPath.length());
+ result = replacement + hostPath.substring( prefix.length(), hostPath.length() );
}
-
return result;
}
/**
* Checks whether the {@code nodeList} contains the {@code node}.<br>
* If the {@code nodeList} doesn't contain the {@code node}, returns null.
- *
*/
private DeltaResourceInfo containsNode(DeltaResourceInfo node, List<DeltaResourceInfo> nodeList, String prefix) {
File file = new File(node.getFullPath());
}
// file
else {
- if ( node.getFullPath().equals( prefix + tempNode.getFullPath()) ) {
+ if ( node.getFullPath().equals(prefix + tempNode.getFullPath()) ) {
return tempNode;
}
}
protected boolean isDirectory(String path) {
return path.endsWith("/");
}
-
- protected void partialInstall( List<DeltaResourceInfo> deltaInfoList ) throws CoreException {
+
+ protected void partialInstall(List<DeltaResourceInfo> deltaInfoList) throws CoreException {
String strRemotePath = null;
String strProjectPath = project.getLocation().toString();
String strRemoteAbsolutePath = null;
}
strRemotePath = getRemotePathOfDelta(interestNode, strProjectPath, node);
strRemoteAbsolutePath = strAppInstallPath + "/" + strRemotePath;
-
type = node.getType();
if ( DeltaResourceInfo.TYPE_MODIFY.equals(type) || DeltaResourceInfo.TYPE_ADD.equals(type) ) {
try {
tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_PUSH_DIRECTORY_COMMAND, strRemoteAbsolutePath), true, TizenPlatformConstants.CMD_SUCCESS);
}
else {
- SyncResult result = getSyncService().push(node.getFullPath(), device.getFileEntry( strRemoteAbsolutePath ).getParent() );
+ SyncResult result = getSyncService().push(node.getFullPath(), device.getFileEntry( strRemoteAbsolutePath ).getParent());
if ( !result.isOk() ) {
throw new IOException(command);
}
/**
* Returns interestDelta from the {@code deltaInfoList}.
- *
*/
- public List<DeltaResourceInfo> getInterestDelta( List<DeltaResourceInfo> deltaInfoList ) throws CoreException{
+ public List<DeltaResourceInfo> getInterestDelta(List<DeltaResourceInfo> deltaInfoList) throws CoreException {
List<DeltaResourceInfo> delta = new ArrayList<DeltaResourceInfo>();
String strProjectPath = project.getLocation().toString();
DeltaResourceInfo interestNode = null;
}
strRemotePath = getRemotePathOfDelta(interestNode, strProjectPath, node);
-
node.setRemotePath(strRemotePath);
delta.add(node);
getInterestDelta(node.getChildren());
}
public List<DeltaResourceInfo> getDelta() {
- if ( deltaInfoList == null) {
+ if ( deltaInfoList == null ) {
deltaInfoList = deltaDetector.getDelta(null, null);
- strDeltaInfoFile = deltaDetector.makeDeltaFile(null,null);
+ strDeltaInfoFile = deltaDetector.makeDeltaFile(null, null);
}
return deltaInfoList;
}
protected void postInstall() throws CoreException {
SdbCommand sdbCommand = new SdbCommand(device, console, new PkgCmdReceiver(console));
-
int timeout = SdbResponse.SHORT_TIMEOUT;
try {
String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_REINSTALL_COMMAND, pkgType.toLowerCase(), getPkgId());
- //String installCommand = String.format("osp-installer -r %s", getPkgId());
// TODO: Timeout is temporary.
// If "pkgcmd -r" is normal operation, timeout should be removed.
sdbCommand.runCommand(installCommand, new PkgcmdErrorType(), timeout);
- sdbCommand.runCommand( String.format(TizenPlatformConstants.REMOVE_FILE_COMMAND, strAppInstallPath));
+ sdbCommand.runCommand(String.format(TizenPlatformConstants.REMOVE_FILE_COMMAND, strAppInstallPath));
} catch (TimeoutException e) {
newCoreException(RdsDeployer.makeRdsLog(NLS.bind(org.tizen.common.launch.LaunchMessages.SDB_TIMEOUT_EXCEPTION, timeout)), e);
} catch (Exception e) {
getDelta();
String strRemotePath = appInstallPath + RdsDeltaDetector.STR_TREE_DIRECTORY;
-
try {
pushFile(strDeltaInfoFile, strRemotePath);
} catch (Exception e) {
}
}
- public static String makeRdsLog( String log ) {
+ public static String makeRdsLog(String log) {
return RdsMessages.RDS_MODE_PREFIX + " " + log;
}
* @param exception a low-level exception, or <code>null</code> if not
* applicable
*/
- public void newCoreException(String message, Throwable exception) throws CoreException {
+ protected void newCoreException(String message, Throwable exception) throws CoreException {
Status status = new Status(Status.ERROR, CommonPlugin.PLUGIN_ID, message, exception);
throw new CoreException(status);
}
if ( syncService == null ) {
syncService = device.getSyncService();
}
-
return syncService;
}
public static String RDS_PUSH_LOG;
public static String RDS_PUSH_ERROR;
public static String RDS_DELETE_ERROR;
- public static String CANNOT_INSTALL;
public static String RDS_RES_INFO_PUSH_ERROR;
- public static String CANNOT_FIND_RDS_INFO;
- public static String CANNOT_FIND_DELTA;
- public static String CANNOT_PARTIALLY_INSTALL;
public static String RDS_MODE_DISABLED;
public static String RDS_MODE_ENABLED;
public static String RDS_MODE_PREFIX;
+
+ public static String CANNOT_FIND_APPLICATION;
+ public static String CANNOT_FIND_RDS_INFO;
+ public static String CANNOT_FIND_DELTA;
+ public static String CANNOT_INSTALL;
+ public static String CANNOT_PARTIALLY_INSTALL;
}
RDS_PUSH_LOG = Pushing file "{0}" to "{1}" in target...
-RDS_PUSH_ERROR = Failed to push file(s).
-RDS_DELETE_ERROR = Failed to delete file in target.
-CANNOT_INSTALL = Cannot install application.
-RDS_RES_INFO_PUSH_ERROR = Failed to upload resource information for RDS.
-CANNOT_FIND_RDS_INFO = Cannot find information of the latest launch.
-CANNOT_FIND_DELTA = Cannot find information of delta.
-CANNOT_PARTIALLY_INSTALL = Cannot partially upload or reinstall.
+RDS_PUSH_ERROR = Failed to push file(s)
+RDS_DELETE_ERROR = Failed to delete file(s) in target
+RDS_RES_INFO_PUSH_ERROR = Failed to upload resource information for RDS
RDS_MODE_DISABLED = RDS: Off
RDS_MODE_ENABLED = RDS: On
RDS_MODE_PREFIX = [RDS]
+
+CANNOT_INSTALL = Cannot install application
+CANNOT_FIND_APPLICATION = Cannot find installed application. An application might be removed by a user.
+CANNOT_FIND_RDS_INFO = Cannot find information of the latest launch
+CANNOT_FIND_DELTA = Cannot find information of delta
+CANNOT_PARTIALLY_INSTALL = Cannot partially upload or reinstall
protected boolean hasProjectSpecificOptions(IProject project) {
boolean isSpecificOption = false;
String specificOption = "";
-
-
try {
specificOption = project.getPersistentProperty(RDS_PROPERTIES_SPECIFIC_OPTION_NAME);
} catch (CoreException e) {
prefStore.setValue(RDS_OPTION_ID, btnRdsCheck.getSelection());
}
}
-
+
public boolean getRdsOption() {
boolean isRdsOption = false;
IProject project = getProject();
} catch (CoreException e) {
isRdsOption = false;
}
-
- if ( OPTION_ENABLE.equals(rdsOption) ) {
- isRdsOption = true;
- }
- else {
- isRdsOption = false;
- }
+ isRdsOption = OPTION_ENABLE.equals(rdsOption);
}
else {
isRdsOption = prefStore.getBoolean(RDS_OPTION_ID);
}
-
return isRdsOption;
}
if ( projectType == null || projectType.isReferencedProject() == false ) {
continue;
}
-
if ( projectType.isReferencedProject() ) {
return false;
}
}
}
} catch (CoreException e) {
- logger.error("Failed to read the referenced project list.", e);
+ logger.error("Failed to read the referenced project list", e);
return false;
}
}
-
if ( project != null ) {
try {
projectSpecificOption = project.getPersistentProperty(RDS_PROPERTIES_SPECIFIC_OPTION_NAME);
} catch (CoreException e) {
- logger.error("Failed to read project specific option.", e);
+ logger.error("Failed to read project specific option", e);
}
}
- if ( OPTION_ENABLE.equals(projectSpecificOption)) {
+ if ( OPTION_ENABLE.equals(projectSpecificOption) ) {
try {
if ( project != null ) {
rdsOption = project.getPersistentProperty(RDS_PROPERTIES_RDS_OPTION_NAME);
}
} catch (CoreException e) {
- logger.error("Failed to read RDS option.", e);
+ logger.error("Failed to read RDS option", e);
}
-
return OPTION_ENABLE.equals(rdsOption);
}
else {
}
}
- // TODO : refactoring this method, this method is temporary, hybrid-app RDS support in webapp
+ // TODO: refactoring this method, this method is temporary, hybrid-app RDS support in webapp
public static boolean isWebRdsMode( IProject project ) {
String projectSpecificOption = "";
String rdsOption = OPTION_DISABLE;
} catch (CoreException e) {
logger.error("Failed to read project specific option.", e);
}
- if ( OPTION_ENABLE.equals(projectSpecificOption)) {
+ if ( OPTION_ENABLE.equals(projectSpecificOption) ) {
try {
rdsOption = project.getPersistentProperty(RDS_PROPERTIES_RDS_OPTION_NAME);
} catch (CoreException e) {
logger.error("Failed to read RDS option.", e);
}
-
return OPTION_ENABLE.equals(rdsOption);
}
else {
return runCommand(command, messages, defaultTimeout);
}
- public CommandErrorType runCommand(String command, CommandErrorType errorMessages, int timeout) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException{
+ public CommandErrorType runCommand(String command, CommandErrorType errorMessages, int timeout) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
print("$ " + command);
device.executeShellCommand( makeCommandWithExitcode(command), receiver, timeout);
package org.tizen.common.sdb.command.message;
-public class CommandErrorException extends Exception{
+public class CommandErrorException extends Exception {
private static final long serialVersionUID = 1L;
-
public CommandErrorException() {
super();
}
}
@Override
- public void makeException() throws CommandErrorException{
+ public void makeException() throws CommandErrorException {
if (errorType == null ) {
throw new CommandErrorException(PkgcmdErrorMessages.ERROR_UNKNOWN);
}
return getMessage();
}
- private String parseErrorMessage( ) {
+ private String parseErrorMessage() {
int startIdx = commandOutput.indexOf(ERROR_MESSAGE_TEMPLATE);
int endIdx = commandOutput.indexOf(System.getProperty("line.separator"), startIdx);
ArrayUtil.iterate(
ArrayUtil.convertToWrapper( str.toCharArray() ),
- new IteratingRunner<Character>()
- {
+ new IteratingRunner<Character>() {
public void run( Character arg )
{
if (Character.isDigit( arg )) {
}
return sb.toString();
}
- public static String asString(InputStream is) throws IOException{
+
+ public static String asString(InputStream is) throws IOException {
StringBuffer out = new StringBuffer();
byte[] b = new byte[4096];
- for (int n; (n = is.read(b)) != -1;)
- {
+ for (int n; (n = is.read(b)) != -1;) {
out.append(new String(b,0,n));
}
return out.toString();
* @author Ho Namkoong {@literal <ho.namkoong@samsung.com>} (S-Core)
*
*/
-public class EclipseAppender extends AppenderSkeleton{
+public class EclipseAppender extends AppenderSkeleton {
/**
* Constructor for {@link EclipseAppender}
* @author Ho Namkoong{@literal <ho.namkoong@samsung.com>} (S-Core)
*/
@Test
- public void test_root_on() throws Exception{
+ public void test_root_on() throws Exception {
String[] serials = getSerialNumber();
runAndWait(MessageFormat.format("{0} -s {1} {2}", SDB_PATH, serials[0], "root off"));
* @author Ho Namkoong{@literal <ho.namkoong@samsung.com>} (S-Core)
*/
@Test
- public void test_shell() throws Exception{
+ public void test_shell() throws Exception {
String[] serials = getSerialNumber();
IShell shell = run(String.format("%s -s %s %s", SDB_PATH, serials[0], "shell"));
shell.write("exit", 1000);
* @author Ho Namkoong{@literal <ho.namkoong@samsung.com>} (S-Core)
*/
@Test
- public void test_status_window() throws Exception{
+ public void test_status_window() throws Exception {
class StatusWindowResult {
@Pattern(pattern = "State:{0}", index = 0)