ClientLoader: don't fail patching to hidden files
FileOutputStream (by design) passes FILE_ATTRIBUTE_NORMAL and CREATE_ALWAYS to CreateFile, which causes it to fail with access denied if it is opening a FILE_ATTRIBUTE_HIDDEN or FILE_ATTRIBUTE_SYSTEM file See JDK-8047342
This commit is contained in:
@@ -36,7 +36,6 @@ import java.applet.Applet;
|
|||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -487,7 +486,7 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try (HashingOutputStream hos = new HashingOutputStream(Hashing.sha512(), new FileOutputStream(PATCHED_CACHE));
|
try (HashingOutputStream hos = new HashingOutputStream(Hashing.sha512(), java.nio.file.Files.newOutputStream(PATCHED_CACHE.toPath()));
|
||||||
InputStream patch = ClientLoader.class.getResourceAsStream("/client.patch"))
|
InputStream patch = ClientLoader.class.getResourceAsStream("/client.patch"))
|
||||||
{
|
{
|
||||||
new FileByFileV1DeltaApplier().applyDelta(VANILLA_CACHE, patch, hos);
|
new FileByFileV1DeltaApplier().applyDelta(VANILLA_CACHE, patch, hos);
|
||||||
|
|||||||
Reference in New Issue
Block a user