コード例 #1
0
        public static JarEntry getConfigFileEntry(JarFile mcoJarFile, string mcoName, string fileName)
        {
            JarEntry entry = mcoJarFile.getJarEntry(mcoName + '/' + fileName);

            if (entry == null)
            {
                entry = mcoJarFile.getJarEntry(mcoName + '\\' + fileName);
            }
            return(entry);
        }
コード例 #2
0
        protected internal override ResourceLocator getResource(string subdirectoryName, string resourceName)
        {
            string fullLocation = string.format(Locale.ENGLISH, "%s%s/%s", rootPath, subdirectoryName, resourceName);

            try
            {
                using (JarFile jar = new JarFile(jarFile))
                {
                    JarEntry entry = jar.getJarEntry(fullLocation);
                    if (entry == null)
                    {
                        return(null);
                    }
                    return(getEntryLocator(entry.Name));
                }
            }
            catch (Exception e)
            {
                throw new System.ArgumentException(Messages.format("Error loading resource from JAR file: {}", jarFile), e);
            }
        }