Index: trunk/psModules/src/config/pmConfig.c
===================================================================
--- trunk/psModules/src/config/pmConfig.c	(revision 11245)
+++ trunk/psModules/src/config/pmConfig.c	(revision 11292)
@@ -4,6 +4,6 @@
  *  @author EAM (IfA)
  *
- *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-23 03:19:35 $
+ *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-01-26 00:05:18 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -24,7 +24,13 @@
 #include <glob.h>
 #include <pslib.h>
+
 #include "pmConfig.h"
+#include "pmErrorCodes.h"
 #include "pmConfigRecipes.h"
 #include "pmConfigCamera.h"
+
+#ifdef HAVE_NEBCLIENT
+#include <nebclient.h>
+#endif // ifdef HAVE_NEBCLIENT
 
 #define PS_SITE "PS_SITE"         // Name of the environment variable containing the site config file
@@ -1047,13 +1053,13 @@
 
 // convert the supplied name, create a new output psString
-psString pmConfigConvertFilename(const char *filename, const pmConfig *config)
+psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create)
 {
     PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    psString newName = psStringCopy (filename);
-
     // strip file:// from front of name
-    if (!strncasecmp (newName, "file:", strlen("file:"))) {
+    if (!strncasecmp(filename, "file:", strlen("file:"))) {
+        psString newName = psStringCopy(filename);
+
         char *point = newName + strlen("file:");
         while (*point == '/')
@@ -1063,9 +1069,13 @@
         psFree (newName);
         newName = tmpName;
+
+        return newName;
     }
 
     // replace path://PATH with matched datapath
-    if (!strncasecmp (newName, "path://", strlen("path://"))) {
+    if (!strncasecmp(filename, "path://", strlen("path://"))) {
         PS_ASSERT_METADATA_NON_NULL(config->site, NULL);
+
+        psString newName = psStringCopy(filename);
 
         // filename should be of the form: path://PATH/rest/of/file
@@ -1102,8 +1112,55 @@
         psFree(newName);
         newName = tmpName;
+
+        return newName;
     }
 
     // substitute neb://name with matched nebulous name
-
-    return newName;
-}
+    if (!strncasecmp(filename, "neb://", strlen("neb://"))) {
+        #ifdef HAVE_NEBCLIENT
+
+        bool status = false;
+        psString nebulous_server = psMetadataLookupStr(&status, config->site, "NEBULOUS_SERVER");
+        if (!status) {
+            psError(PM_ERR_CONFIG, true, "failed to lookup config value for NEBULOUS_SERVER.");
+            return NULL;
+        }
+        if (!nebulous_server) {
+            psError(PM_ERR_CONFIG, true, "Could not determine nebulous server URI.");
+            return NULL;
+        }
+
+        nebServer *server = nebServerAlloc(nebulous_server);
+        if (!server) {
+            psError(PM_ERR_SYS, true, "failed to create a nebServer object.");
+            nebServerFree(server);
+            return NULL;
+        }
+
+        psString newName = psStringCopy(filename);
+
+        // for for the nebulous key
+        char *foo = nebFind(server, newName);
+        // if it doesn't exist, create it
+        if (!foo) {
+            foo = nebCreate(server, newName, 0, NULL, NULL, NULL);
+        }
+
+        psFree(newName);
+        psString newFoo = psStringCopy(foo);
+        psFree(foo);
+        nebServerFree(server);
+
+        return newFoo;
+
+        #else // ifdef HAVE_NEBCLIENT
+
+        psError(PM_ERR_PROG, true, "psModules was compiled without nebulous support.");
+        return NULL;
+        #endif // ifdef HAVE_NEBCLIENT
+
+    }
+
+    // if we go this far, do nothing
+    return psStringCopy(filename);
+}
