UnresolvedErr
Inheritance: Err
Ejemplo n.º 1
0
        public new static UnresolvedErr make(string msg, Err cause)
        {
            UnresolvedErr err = new UnresolvedErr();

            make_(err, msg, cause);
            return(err);
        }
Ejemplo n.º 2
0
        public static UriScheme find(string scheme, bool check)
        {
            // check cache
            lock (m_cache)
            {
                UriScheme cached = (UriScheme)m_cache[scheme];
                if (cached != null)
                {
                    return(cached);
                }
            }

            try
            {
                // lookup scheme type (avoid building index for common types)
                Type t = null;
                if (scheme == "fan")
                {
                    t = Sys.FanSchemeType;
                }
                if (scheme == "file")
                {
                    t = Sys.FileSchemeType;
                }
                if (t == null)
                {
                    string qname = (string)Env.cur().index("sys.uriScheme." + scheme).first();
                    if (qname == null)
                    {
                        throw UnresolvedErr.make().val;
                    }
                    t = Type.find(qname);
                }

                // allocate instance
                UriScheme s = (UriScheme)t.make();
                s.m_scheme = scheme;

                // add to cache
                lock (m_cache)
                {
                    UriScheme cached = (UriScheme)m_cache[scheme];
                    if (cached != null)
                    {
                        return(cached);
                    }
                    m_cache[scheme] = s;
                }

                return(s);
            }
            catch (UnresolvedErr.Val) {}
            catch (System.Exception e) { Err.dumpStack(e); }

            if (!check)
            {
                return(null);
            }
            throw UnresolvedErr.make("Unknown scheme: " + scheme).val;
        }
Ejemplo n.º 3
0
        //////////////////////////////////////////////////////////////////////////
        // Find Files
        //////////////////////////////////////////////////////////////////////////

        public override File findFile(Uri uri, bool check)
        {
            if (uri.isPathAbs())
            {
                throw ArgErr.make("Uri must be relative: " + uri).val;
            }
            File f = m_homeDir.plus(uri, false);

            if (f.exists())
            {
                return(f);
            }
            if (!check)
            {
                return(null);
            }
            throw UnresolvedErr.make("File not found in Env: " + uri).val;
        }
Ejemplo n.º 4
0
 public Fan.Sys.File file(Uri uri, bool check)
 {
     loadFiles();
     if (!uri.isPathAbs())
     {
         throw ArgErr.make("Pod.files Uri must be path abs: " + uri).val;
     }
     if (uri.auth() != null && !uri.toStr().StartsWith(this.uri().toStr()))
     {
         throw ArgErr.make("Invalid base uri `" + uri + "` for `" + this.uri() + "`").val;
     }
     else
     {
         uri = this.uri().plus(uri);
     }
     Fan.Sys.File f = (Fan.Sys.File)m_filesMap[uri];
     if (f != null || !check)
     {
         return(f);
     }
     throw UnresolvedErr.make(uri.toStr()).val;
 }
Ejemplo n.º 5
0
 public static void make_(UnresolvedErr self, string msg, Err cause)
 {
     Err.make_(self, msg, cause);
 }
Ejemplo n.º 6
0
 public static void make_(UnresolvedErr self, string msg)
 {
     make_(self, msg, null);
 }
Ejemplo n.º 7
0
 public static void make_(UnresolvedErr self)
 {
     make_(self, null);
 }
Ejemplo n.º 8
0
 public static void make_(UnresolvedErr self, string msg, Err cause)
 {
     Err.make_(self, msg, cause);
 }
Ejemplo n.º 9
0
 public static void make_(UnresolvedErr self, string msg)
 {
     make_(self, msg, null);
 }
Ejemplo n.º 10
0
 public static void make_(UnresolvedErr self)
 {
     make_(self, null);
 }
Ejemplo n.º 11
0
 public static new UnresolvedErr make(string msg, Err cause)
 {
     UnresolvedErr err = new UnresolvedErr();
       make_(err, msg, cause);
       return err;
 }