Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create validation markers in separate .getdown directory. #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions core/src/main/java/com/threerings/getdown/data/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@

package com.threerings.getdown.data;

import java.io.*;
import static com.threerings.getdown.Log.log;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.security.MessageDigest;
import java.util.Collections;
import java.util.Comparator;
Expand All @@ -20,8 +26,6 @@
import com.threerings.getdown.util.ProgressObserver;
import com.threerings.getdown.util.StringUtil;

import static com.threerings.getdown.Log.log;

/**
* Models a single file resource used by an {@link Application}.
*/
Expand Down Expand Up @@ -136,7 +140,7 @@ public Resource (String path, URL remote, File local, EnumSet<Attr> attrs)
_local = local;
_localNew = new File(local.toString() + "_new");
String lpath = _local.getPath();
_marker = new File(lpath + "v");
_marker = new File(".getdown", lpath + "v");

_attrs = attrs;
_isJar = isJar(lpath);
Expand Down Expand Up @@ -263,6 +267,7 @@ public boolean isMarkedValid ()
public void markAsValid ()
throws IOException
{
Files.createDirectories(_marker.getParentFile().toPath());
_marker.createNewFile();
}

Expand Down