9cc4ce16befd7694963bdb46b6e9b4d28a6930cc
hiram
  Thu Apr 6 14:29:04 2023 -0700
adding endpoint /list/files function to list hgdownload files refs #23589

diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c
index ae8d8d1..e249789 100644
--- src/hg/hubApi/hubApi.c
+++ src/hg/hubApi/hubApi.c
@@ -35,30 +35,31 @@
 /* this selects output type 'arrays', where the default type is: objects */
 boolean jsonOutputArrays = FALSE; /* set by CGI parameter 'jsonOutputArrays' */
 
 boolean measureTiming = FALSE;	/* set by CGI parameters */
 
 /* downloadUrl for use in error exits when reachedMaxItems */
 struct dyString *downloadUrl = NULL;
 
 /* valid argument listings to verify extraneous arguments */
 char *argListPublicHubs[] = { NULL };
 char *argListUcscGenomes[] = { NULL };
 char *argListHubGenomes[] = { argHubUrl, NULL };
 char *argListTracks[] = { argGenome, argHubUrl, argTrackLeavesOnly, NULL };
 char *argListChromosomes[] = { argGenome, argHubUrl, argTrack, NULL };
 char *argListSchema[] = { argGenome, argHubUrl, argTrack, NULL };
+char *argListFiles[] = { argGenome, NULL };
 char *argGetDataTrack[] = { argGenome, argHubUrl, argTrack, argChrom, argStart, argEnd, argMaxItemsOutput, argJsonOutputArrays, NULL };
 char *argGetDataSequence[] = { argGenome, argHubUrl, argTrack, argChrom, argStart, argEnd, NULL };
 char *argSearch[] = {argSearchTerm, argGenome, argHubUrl, argCategories, NULL};
 
 /* Global only to this one source file */
 static struct cart *cart;             /* CGI and other variables */
 static struct hash *oldVars = NULL;
 static struct hash *trackCounter = NULL;
 static long totalTracks = 0;
 static boolean allTrackSettings = FALSE;	/* checkbox setting */
 static char **shortLabels = NULL;	/* public hub short labels in array */
 static int publicHubCount = 0;
 static char *defaultHub = "Synonymous Constraint";
 static char *defaultDb = "ce11";
 long enteredMainTime = 0;	/* will become = clock1000() on entry */
@@ -1249,36 +1250,39 @@
 struct dyString *errorMsg = dyStringNew(128);
 
 // first check for curated hubs
 if (isEmpty(hubUrl) && isNotEmpty(db))
     {
     char *newHubUrl;
     if (hubConnectGetCuratedUrl(db, &newHubUrl))
         {
         hubUrl = newHubUrl;  // use curated hub hubUrl
         cgiVarSet("hubUrl", hubUrl);   // subsequent code grabs hubUrl from env
         }
     }
 
 if (isEmpty(hubUrl) && isNotEmpty(db))
     {
+    if ( ! isGenArk(db) )
+	{
 	struct sqlConnection *conn = hAllocConnMaybe(db);
 	if (NULL == conn)
-        dyStringPrintf(errorMsg, "can not find genome genome='%s' for endpoint '%s'", db, pathInfo);
+	    dyStringPrintf(errorMsg, "can not find genome='%s' for endpoint '%s'", db, pathInfo);
 	else
 	    hFreeConn(&conn);
 	}
+    }
 if (isNotEmpty(start) || isNotEmpty(end))
     {
     long long llStart = -1;
     long long llEnd = -1;
     struct errCatch *errCatch = errCatchNew();
     if (errCatchStart(errCatch))
         {
         if (isNotEmpty(start))
             llStart = sqlLongLong(start);
         if (isNotEmpty(end))
             llEnd = sqlLongLong(end);
         }
     errCatchEnd(errCatch);
     if (errCatch->gotError)
         {