public static void indexAllShares() {
		D.out("Indexing all shares...");
		Indexer.addObservers();
		Indexer.openFile();
		Indexer.writeIndexBeginToFile();
		String[] shareNames = ShareManager.instance().getShareNames();
		if (shareNames != null) {
			for (String shareName: shareNames) {
				Share currentShare = ShareManager.instance().getShare(shareName);
				if (currentShare == null) {
					continue;
				}
				File shareDirectory = currentShare.getLocation();
				if (shareDirectory == null) {
					continue;
				}
				Indexer.writeShareStart(shareName);
				//	FileNameObserver needs to cut filename paths at shareDirectory to save space
				if (Indexer.fno != null) {
					Indexer.fno.shareLocation = shareDirectory.getAbsolutePath();
				}
				Indexer.indexFileOrDirectory(shareDirectory);
				Indexer.writeShareEnd(shareName);
			}
		}
		if (!IndexerThread.restartIndexer) {
			Indexer.indexStats();
			Indexer.writeIndexEndToFile();
			D.out("Done indexing all shares");
		}
		Indexer.closeFile();
		Indexer.delObservers();
	}