Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor
24  src/org/AndroidShareApp/core/NetworkManager.java
@@ -225,15 +225,29 @@ public void setBroadcastAddress(InetAddress broadcastAddress) {
225 225
 		mBroadcastAddress = broadcastAddress;
226 226
 	}
227 227
 	
228  
-	/** TODO: this function **/
  228
+	/** Return fullPath using a relativePath
  229
+	 *  if there is no item with relativePath, returns null **/
229 230
 	public String getSharedByMeItemFullPath(String relativePath){
230  
-		return "/mnt/sdcard/teste.txt";
  231
+		Iterator<SharedByMeItem> itr = mSharedByMeItems.iterator();
  232
+		while (itr.hasNext()) {
  233
+			SharedByMeItem sharedByMeItem = itr.next();
  234
+			if (sharedByMeItem.getSharedPath().compareTo(relativePath) == 0) {
  235
+				return sharedByMeItem.getFullPath();
  236
+			}
  237
+		}
  238
+		return null;
231 239
 	}
232 240
 	
233 241
 	/** Start servers **/
234 242
 	public void startServers(){
235  
-		mNetworkSender.start();
236  
-		mNetworkListener.start();
237  
-		mFileServer.start();
  243
+		if (!mNetworkSender.isAlive()){
  244
+			mNetworkSender.start();
  245
+		}
  246
+		if (!mNetworkListener.isAlive()){
  247
+			mNetworkListener.start();
  248
+		}
  249
+		if (!mFileServer.isAlive()){
  250
+			mFileServer.start();
  251
+		}
238 252
 	}
239 253
 }

No commit comments for this range

Something went wrong with that request. Please try again.