diff options
author | Uwe Stieber | 2012-06-12 18:50:41 +0000 |
---|---|---|
committer | Uwe Stieber | 2012-06-12 18:50:41 +0000 |
commit | e896bcf968e37540d8f7241d7ec589ccf2274a43 (patch) | |
tree | a84b40e2ee443ac9be576686d7f548f4fd1d44fd /target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src | |
parent | 1c405762430e121793064bc625428db28dc14e14 (diff) | |
download | org.eclipse.tcf-e896bcf968e37540d8f7241d7ec589ccf2274a43.tar.gz org.eclipse.tcf-e896bcf968e37540d8f7241d7ec589ccf2274a43.tar.xz org.eclipse.tcf-e896bcf968e37540d8f7241d7ec589ccf2274a43.zip |
Target Explorer: Fix newly added unit tests and revealed issues
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src')
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/filetransfer/FileTransferItem.java | 202 |
1 files changed, 101 insertions, 101 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/filetransfer/FileTransferItem.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/filetransfer/FileTransferItem.java index efe020455..51ef796e7 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/filetransfer/FileTransferItem.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/filetransfer/FileTransferItem.java @@ -1,101 +1,101 @@ -/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tcf.te.runtime.services.filetransfer;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-
-/**
- * FileTransferItem
- */
-public class FileTransferItem extends PropertiesContainer implements IFileTransferItem {
-
- /**
- * Constructor.
- */
- public FileTransferItem() {
- setProperty(PROPERTY_ENABLED, true);
- setProperty(PROPERTY_DIRECTION, HOST_TO_TARGET);
- }
-
- public FileTransferItem(IPath fromHost, IPath toTarget) {
- this();
- setProperty(PROPERTY_HOST, fromHost.toPortableString());
- setProperty(PROPERTY_TARGET, toTarget.toPortableString());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- return getBooleanProperty(PROPERTY_ENABLED);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getHostPath()
- */
- @Override
- public IPath getHostPath() {
- return getStringProperty(PROPERTY_HOST) != null ? new Path(getStringProperty(PROPERTY_HOST)) : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getTargetPath()
- */
- @Override
- public IPath getTargetPath() {
- return getStringProperty(PROPERTY_TARGET) != null ? new Path(getStringProperty(PROPERTY_TARGET)) : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getDirection()
- */
- @Override
- public int getDirection() {
- int direction = getIntProperty(PROPERTY_DIRECTION);
- return direction == TARGET_TO_HOST ? TARGET_TO_HOST : HOST_TO_TARGET;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getOptions()
- */
- @Override
- public String getOptions() {
- return getStringProperty(PROPERTY_OPTIONS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#hashCode()
- */
- @Override
- public int hashCode() {
- int hc = getHostPath() != null ? getHostPath().hashCode() : 0;
- hc = hc << 8 + (getTargetPath() != null ? getTargetPath().hashCode() : 0);
- hc = hc << 8 + getDirection();
- return hc;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof IFileTransferItem) {
- return getHostPath().equals(((IFileTransferItem)obj).getHostPath()) &&
- getTargetPath().equals(((IFileTransferItem)obj).getTargetPath()) &&
- getDirection() == ((IFileTransferItem)obj).getDirection();
- }
- return super.equals(obj);
- }
-}
+/******************************************************************************* + * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ + +package org.eclipse.tcf.te.runtime.services.filetransfer; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; +import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem; + +/** + * FileTransferItem + */ +public class FileTransferItem extends PropertiesContainer implements IFileTransferItem { + + /** + * Constructor. + */ + public FileTransferItem() { + setProperty(PROPERTY_ENABLED, true); + setProperty(PROPERTY_DIRECTION, HOST_TO_TARGET); + } + + public FileTransferItem(IPath fromHost, IPath toTarget) { + this(); + setProperty(PROPERTY_HOST, fromHost.toPortableString()); + setProperty(PROPERTY_TARGET, toTarget.toPortableString()); + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#isEnabled() + */ + @Override + public boolean isEnabled() { + return getBooleanProperty(PROPERTY_ENABLED); + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getHostPath() + */ + @Override + public IPath getHostPath() { + return getStringProperty(PROPERTY_HOST) != null ? new Path(getStringProperty(PROPERTY_HOST)) : null; + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getTargetPath() + */ + @Override + public IPath getTargetPath() { + return getStringProperty(PROPERTY_TARGET) != null ? new Path(getStringProperty(PROPERTY_TARGET)) : null; + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getDirection() + */ + @Override + public int getDirection() { + int direction = getIntProperty(PROPERTY_DIRECTION); + return direction == TARGET_TO_HOST ? TARGET_TO_HOST : HOST_TO_TARGET; + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IFileTransferItem#getOptions() + */ + @Override + public String getOptions() { + return getStringProperty(PROPERTY_OPTIONS); + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#hashCode() + */ + @Override + public int hashCode() { + int hc = getHostPath() != null ? getHostPath().hashCode() : 0; + hc = hc << 8 + (getTargetPath() != null ? getTargetPath().hashCode() : 0); + hc = hc << 8 + getDirection(); + return hc; + } + + /* (non-Javadoc) + * @see org.eclipse.tcf.te.runtime.properties.PropertiesContainer#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (obj instanceof IFileTransferItem) { + return getHostPath() != null ? getHostPath().equals(((IFileTransferItem)obj).getHostPath()) : ((IFileTransferItem)obj).getHostPath() == null + && getTargetPath() != null ? getTargetPath().equals(((IFileTransferItem)obj).getTargetPath()) : ((IFileTransferItem)obj).getTargetPath() == null + && getDirection() == ((IFileTransferItem)obj).getDirection(); + } + return super.equals(obj); + } +} |