Changeset 1543 for trunk/src/org/expeditee
- Timestamp:
- 11/18/20 11:15:44 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameUtils.java
r1538 r1543 1831 1831 // Extract private resources 1832 1832 Path resourcesPrivate = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-private"); 1833 extractResources("org/expeditee/assets/resources-private ", resourcesPrivate, force);1833 extractResources("org/expeditee/assets/resources-private/", resourcesPrivate, force); 1834 1834 1835 1835 // Extract public resources 1836 1836 Path resourcesPublic = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-public"); 1837 extractResources("org/expeditee/assets/resources-public ", resourcesPublic, force);1837 extractResources("org/expeditee/assets/resources-public/", resourcesPublic, force); 1838 1838 } else if (AuthenticatorBrowser.isAuthenticationRequired()) { 1839 1839 // Deal with the instance of being in the old regime but using authentication. … … 1841 1841 // Ensure additional framesets 1842 1842 Path framesetsDir = Paths.get(FrameIO.FRAME_PATH); 1843 boolean extracted = extractResources("org/expeditee/assets/resources-public/framesets ", framesetsDir, force);1843 boolean extracted = extractResources("org/expeditee/assets/resources-public/framesets/", framesetsDir, force); 1844 1844 1845 1845 // Ensure additional images 1846 1846 Path imagesDir = Paths.get(FrameIO.IMAGES_PATH); 1847 extracted |= extractResources("org/expeditee/assets/resources-public/images ", imagesDir, force);1847 extracted |= extractResources("org/expeditee/assets/resources-public/images/", imagesDir, force); 1848 1848 1849 1849 // Ensure deaddrops area exists … … 1896 1896 private static boolean extractResources(String source, Path destination, boolean force) { 1897 1897 // If resources have already been extracted, and we are not forcing the extraction, there is nothing to do. 1898 1898 1899 if (!force && destination.resolve(".res").toFile().exists()) { 1899 1900 return false; … … 1907 1908 ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); 1908 1909 URL resourceUrl = classLoader.getResource(source); 1910 1909 1911 if (resourceUrl.getProtocol().equals("jar")) { 1910 1912 try { … … 1959 1961 continue; 1960 1962 } 1961 File out = destination.resolve(ze.getName().substring(source.length())).toFile(); 1963 1964 // Note: 1965 // 'source' needs to be specified as directory ending in a "/" 1966 // If it doesn't then 'ze_name_rel' incorrectly presents as an absolute name 1967 // 1968 // As this is a private method, the "/" requirement is considered a reasonable 1969 // requirement to ensure is applied within this class. 1970 1971 String ze_name = ze.getName(); 1972 String ze_name_rel = ze_name.substring(source.length()); 1973 1974 File out = destination.resolve(ze_name_rel).toFile(); 1975 1962 1976 if (ze.isDirectory()) { 1963 1977 out.mkdirs();
Note:
See TracChangeset
for help on using the changeset viewer.