package com.dropbox.core;

import com.dropbox.core.util.IOUtil;
import com.dropbox.core.util.StringUtil;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.regex.Pattern;

/*>>> import checkers.nullness.quals.Nullable; */

public class DbxSdkVersion
{
    public static final String Version;
    static {
        Version = loadVersion();
    }

    private static final String ResourceName = "/com/dropbox/core/sdk-version.txt";

    private static final class LoadException extends Exception {
        private static final long serialVersionUID = 0L;

        public LoadException(/*@Nullable*/String message) {
            super(message);
        }
    }

    private static String loadLineFromResource()
        throws LoadException
    {
        try {
            InputStream in = DbxSdkVersion.class.getResourceAsStream(ResourceName);
            if (in == null) throw new LoadException("Not found.");
            try {
                BufferedReader bin = new BufferedReader(IOUtil.utf8Reader(in));
                String version = bin.readLine();
                if (version == null) throw new LoadException("No lines.");
                String secondLine = bin.readLine();
                if (secondLine != null) throw new LoadException("Found more than one line.  Second line: " + StringUtil.jq(secondLine));
                return version;
            }
            finally {
                IOUtil.closeInput(in);
            }
        }
        catch (IOException ex) {
            throw new LoadException(ex.getMessage());
        }
    }

    private static String loadVersion()
    {
        try {
            String version = loadLineFromResource();

            Pattern versionRegex = Pattern.compile("[0-9]+(?:\\.[0-9]+)*(?:-[-_A-Za-z0-9]+)?");
            if (!versionRegex.matcher(version).matches()) {
                throw new LoadException("Text doesn't follow expected pattern: " + StringUtil.jq(version));
            }

            return version;
        }
        catch (LoadException ex) {
            throw new RuntimeException("Error loading version from resource \"sdk-version.txt\": " + ex.getMessage());
        }
    }
}

@@ -24,2182 +24,304 @@
 e;%0A%0A
-import com.dropbox.core.util.IOUtil;%0Aimport com.dropbox.core.util.StringUtil;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.regex.Pattern;%0A%0A/*%3E%3E%3E import checkers.nullness.quals.Nullable; */%0A%0Apublic class DbxSdkVersion%0A%7B%0A    public static final String Version;%0A    static %7B%0A        Version = loadVersion();%0A    %7D%0A%0A    private static final String ResourceName = %22/com/dropbox/core/sdk-version.txt%22;%0A%0A    private static final class LoadException extends Exception %7B%0A        private static final long serialVersionUID = 0L;%0A%0A        public LoadException(/*@Nullable*/String message) %7B%0A            super(message);%0A        %7D%0A    %7D%0A%0A    private static String loadLineFromResource()%0A        throws LoadException%0A    %7B%0A        try %7B%0A            InputStream in = DbxSdkVersion.class.getResourceAsStream(ResourceName);%0A            if (in == null) throw new LoadException(%22Not found.%22);%0A            try %7B%0A                BufferedReader bin = new BufferedReader(IOUtil.utf8Reader(in));%0A                String version = bin.readLine();%0A                if (version == null) throw new LoadException(%22No lines.%22);%0A                String secondLine = bin.readLine();%0A                if (secondLine != null) throw new LoadException(%22Found more than one line.  Second line: %22 + StringUtil.jq(secondLine));%0A                return version;%0A            %7D%0A            finally %7B%0A                IOUtil.closeInput(in);%0A            %7D%0A        %7D%0A        catch (IOException ex) %7B%0A            throw new LoadException(ex.getMessage());%0A        %7D%0A    %7D%0A%0A    private static String loadVersion()%0A    %7B%0A        try %7B%0A            String version = loadLineFromResource();%0A%0A            Pattern versionRegex = Pattern.compile(%22%5B0-9%5D+(?:%5C%5C.%5B0-9%5D+)*(?:-%5B-_A-Za-z0-9%5D+)?%22);%0A            if (!versionRegex.matcher(version).matches()) %7B%0A                throw new LoadException(%22Text doesn't follow expected pattern: %22 + StringUtil.jq(version));%0A            %7D%0A%0A            return version;%0A        %7D%0A        catch (LoadException ex) %7B%0A            throw new RuntimeException(%22Error loading version from resource %5C%22sdk-version.txt%5C%22: %22 + ex.getMessage());%0A        %7D
+/*%3E%3E%3E import checkers.nullness.quals.Nullable; */%0A%0Apublic class DbxSdkVersion%0A%7B%0A    public static final String Version;%0A    static %7B%0A        Version = loadVersion();%0A    %7D%0A%0A%0A    private static String loadVersion()%0A    %7B%0A        return %223.0.11%22; //TODO: figure out a consistent way to generate it.
 %0A   

Replace the `sqk-version.txt` with hard coded version.