The files aren't being found for some reason... it almost looks like it's trying to unzip your .dat and .txt files which would obviously throw an error.
Maybe post the code from where the error is being thrown?
|
Why do I get this?Attempting to download
java.io.FileNotFoundException: C:\Users\Adam\dcc\Data\Animations\3353.dat (The s
ystem cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at CacheDownloader.unzip(CacheDownloader.java:194)
at CacheDownloader.unZip(CacheDownloader.java:184)
at CacheDownloader.downloadCache(CacheDownloader.java :70)
at client.startUp(client.java:8019)
at RSApplet.run(RSApplet.java:98)
at client.run(client.java:5131)
at java.lang.Thread.run(Unknown Source)
java.io.FileNotFoundException: C:\Users\Adam\dcc\Data\Maps\mapConfig.txt (The sy
stem cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at client.setNewMaps(client.java:204)
at client.startUp(client.java:8020)
at RSApplet.run(RSApplet.java:98)
at client.run(client.java:5131)
at java.lang.Thread.run(Unknown Source)
Map amount = 660Error: 0
java.io.FileNotFoundException: C:\Users\Adam\dcc\Data\Animations\Frames.dat (The
system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at Class36.unpackAnimationData(Class36.java:17)
at client.startUp(client.java:8070)
at RSApplet.run(RSApplet.java:98)
at client.run(client.java:5131)
at java.lang.Thread.run(Unknown Source)
Error: 0
java.io.FileNotFoundException: C:\Users\Adam\dcc\Data\Animations\Skins.dat (The
system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at Class36.unpackAnimationData(Class36.java:40)
at client.startUp(client.java:8070)
at RSApplet.run(RSApplet.java:98)
at client.run(client.java:5131)
at java.lang.Thread.run(Unknown Source)
602 Animations: 13798
508 Object Amount: 38424
602 NPC Amount: 11257
602 GFX Amount: 2617
Spot Anim 1950: 44811, 10965
Couldn't find details2.ini
It doesn't extract the Data, Model and Sprites folder.
The files aren't being found for some reason... it almost looks like it's trying to unzip your .dat and .txt files which would obviously throw an error.
Maybe post the code from where the error is being thrown?
CacheDownloader.java
Code:import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import sign.signlink; public class CacheDownloader { private client client; private final int BUFFER = 1024; private final int VERSION = 1; // Version of cache (Change on client updates) private String cacheLink = "http://conceptionrsps.info/dcc.zip"; // Link to cache private String fileToExtract = getCacheDir() + getArchivedName(); public CacheDownloader(client client) { this.client = client; } public void drawLoadingText(String text) { client.drawLoadingText(35, text); } public void drawLoadingText(int amount, String text) { client.drawLoadingText(amount, text); } public String getCacheDir() { return signlink.findcachedir(); } public String getCacheLink() { return cacheLink; } public int getCacheVersion() { return VERSION; } public CacheDownloader downloadCache() { try { File location = new File(getCacheDir()); File version = new File(getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat"); if (!location.exists()) { downloadFile(getCacheLink(), getArchivedName()); unZip(); BufferedWriter versionFile = new BufferedWriter(new FileWriter( getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat")); versionFile.close(); deleteDownloadedZipFile(getArchivedName()); } else { if (!version.exists()) { // delete(getCacheDir()); downloadFile(getCacheLink(), getArchivedName()); unZip(); BufferedWriter versionFile = new BufferedWriter( new FileWriter(getCacheDir() + "/cacheUpdate" + getCacheVersion() + ".dat")); versionFile.close(); deleteDownloadedZipFile(getArchivedName()); } else { return null; } } } catch (Exception e) { } return null; } public void downloadFile(String adress, String localFileName) { System.out.println("Attempting to download"); OutputStream out = null; URLConnection conn; InputStream in = null; try { URL url = new URL(adress); out = new BufferedOutputStream(new FileOutputStream(getCacheDir() + "/" + localFileName)); conn = url.openConnection(); in = conn.getInputStream(); byte[] data = new byte[BUFFER]; int numRead; long numWritten = 0; int length = conn.getContentLength(); while ((numRead = in.read(data)) != -1) { out.write(data, 0, numRead); numWritten += numRead; int percentage = (int) (((double) numWritten / (double) length) * 100D); drawLoadingText(percentage, "Downloading Cache " + percentage + "%"); } drawLoadingText("Finished downloading " + getArchivedName() + "!"); } catch (Exception exception) { exception.printStackTrace(); } finally { try { if (in != null) { in.close(); } if (out != null) { out.close(); } } catch (IOException ioe) { } } } public String getArchivedName() { int lastSlashIndex = getCacheLink().lastIndexOf('/'); if (lastSlashIndex >= 0 && lastSlashIndex < getCacheLink().length() - 1) { return getCacheLink().substring(lastSlashIndex + 1); } else { } return ""; } public void deleteDownloadedZipFile(String fileName) { File f = new File(getCacheDir() + fileName); if (!f.exists()) throw new IllegalArgumentException( "Delete: no such file or directory: " + fileName); if (!f.canWrite()) throw new IllegalArgumentException("Delete: write protected: " + fileName); if (f.isDirectory()) { String[] files = f.list(); if (files.length > 0) throw new IllegalArgumentException( "Delete: directory not empty: " + fileName); } boolean success = f.delete(); if (!success) throw new IllegalArgumentException("Delete: deletion failed"); } public static boolean delete(String path) { if (path == null || path.trim().length() == 0) return false; return delete(new File(path)); } public static boolean delete(File fileOrDirectory) { if (fileOrDirectory == null) return false; if (!fileOrDirectory.exists()) return false; if (fileOrDirectory.isDirectory()) { for (File childFile : fileOrDirectory.listFiles()) { delete(childFile); } } return fileOrDirectory.delete(); } public void unZip() { try { InputStream in = new BufferedInputStream(new FileInputStream( fileToExtract)); ZipInputStream zin = new ZipInputStream(in); ZipEntry e; while ((e = zin.getNextEntry()) != null) { if (e.isDirectory()) { (new File(getCacheDir() + e.getName())).mkdir(); } else { if (e.getName().equals(fileToExtract)) { unzip(zin, fileToExtract); break; } unzip(zin, getCacheDir() + e.getName()); } } zin.close(); } catch (Exception e) { e.printStackTrace(); } } public void unzip(ZipInputStream zin, String s) throws IOException { FileOutputStream out = new FileOutputStream(s); byte[] b = new byte[BUFFER]; int len = 0; while ((len = zin.read(b)) != -1) { out.write(b, 0, len); } out.close(); } }
This right here:
seems to be where the error is coming from.Code:public void unzip(ZipInputStream zin, String s) throws IOException { FileOutputStream out = new FileOutputStream(s); byte[] b = new byte[BUFFER]; int len = 0; while ((len = zin.read(b)) != -1) { out.write(b, 0, len); } out.close(); }
It is trying to unzip your "C:\Users\Adam\dcc\Data\Animations\3353.dat" file which cannot even be found, although I assume if it were found it would still throw an error due to the fact that it should be unzipping your cache not some .dat file.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |