bool _haveUdl(string nUrl)
        {
            UrlParser urlParser_  = new UrlParser(nUrl);
            string    archiveDir_ = urlParser_._urlDir();

            return(Directory.Exists(archiveDir_));
        }
Beispiel #2
0
        public static string[] _dirUrls(string nUrl)
        {
            List <string> result_    = new List <string>();
            UrlParser     urlParser_ = new UrlParser(nUrl);
            string        urlDir_    = urlParser_._urlDir();

            string[] dirUrls_ = Directory.GetDirectories(urlDir_);
            foreach (string i in dirUrls_)
            {
                int    index_   = i.LastIndexOf(@"\");
                string dirName_ = i.Substring(index_ + 1);
                if (dirName_.StartsWith(@"^arc^"))
                {
                    continue;
                }
                if (dirName_.StartsWith(@"^file^"))
                {
                    continue;
                }
                index_ = dirName_.LastIndexOf(@"^");
                string fileName_ = dirName_.Substring(index_ + 1);
                string urlName_  = nUrl + @"/" + fileName_;
                result_.Add(urlName_);
            }
            return(result_.ToArray());
        }
        public void _newStdUdl <__t>(__t nT, string nUrl) where __t : IStdUdl
        {
            if (!this._isUdl(nUrl))
            {
                return;
            }
            if (this._haveUdl(nUrl))
            {
                return;
            }
            UrlParser urlParser_ = new UrlParser(nUrl);
            string    dirUrl_    = urlParser_._urlDir();

            Directory.CreateDirectory(dirUrl_);

            string        udlHeadstreamUrl_ = nUrl + @"*$descriptor.xml";
            UdlHeadstream udlHeadstream_    = nT._getUdlHeadstream();

            this._writeHeadstream(udlHeadstream_, udlHeadstreamUrl_);

            string udlUrl_ = nUrl + @"*";

            udlUrl_ += udlHeadstream_._getFileName();
            this._writeHeadstream(nT, udlUrl_);
        }
Beispiel #4
0
        public static string[] _files(string nUrl)
        {
            List <string> result_    = new List <string>();
            UrlParser     urlParser_ = new UrlParser(nUrl);
            string        urlDir_    = urlParser_._urlDir();

            string[] fileUrls_ = Directory.GetFiles(urlDir_);
            foreach (string i in fileUrls_)
            {
                int    index_    = i.LastIndexOf(@"\");
                string fileName_ = i.Substring(index_ + 1);
                string urlName_  = nUrl + @"*" + fileName_;
                result_.Add(urlName_);
            }
            return(result_.ToArray());
        }
        bool _udlHaveFile <__t>(__t nT, string nUrl) where __t : IUdl
        {
            UdlHeadstream udlHeadstream_ = nT._getUdlHeadstream();
            string        fileName_      = udlHeadstream_._getFileName();
            UrlParser     urlParser_     = new UrlParser(nUrl);
            string        archiveDir_    = urlParser_._urlDir();

            string[] files_ = Directory.GetFiles(archiveDir_);
            if (files_.Length > 3)
            {
                return(true);
            }
            foreach (string i in files_)
            {
                int    pos_  = i.LastIndexOf("\\");
                string temp_ = i.Substring(pos_ + 1);
                if (temp_ != "$descriptor.xml" && temp_ != fileName_ && temp_ != "$stringTable.xml")
                {
                    return(true);
                }
            }
            return(false);
        }