// Path: src/main/java/org/echocat/gradle/plugins/golang/vcs/RawVcsReference.java
// public class RawVcsReference extends BaseVcsReference {
// 
//     public RawVcsReference(@Nullable VcsType type, @Nonnull String id, @Nullable URI plain, @Nullable String ref, UpdatePolicy updatePolicy) {
//         super(type, id, plain, ref, updatePolicy);
//     }
// 
// }
// 
// Path: src/main/java/org/echocat/gradle/plugins/golang/vcs/VcsException.java
// public class VcsException extends IOException {
// 
//     public VcsException(String message) {
//         super(message);
//     }
// 
//     public VcsException(String message, Throwable cause) {
//         super(messageFor(message, cause), cause);
//     }
// 
//     public VcsException(Throwable cause) {
//         this(null, cause);
//     }
// 
//     protected static String messageFor(String message, Throwable cause) {
//         if (isNotEmpty(message)) {
//             return message;
//         }
//         if (cause != null) {
//             final String causeMessage = cause.getMessage();
//             if (isNotEmpty(causeMessage)) {
//                 return causeMessage;
//             }
//         }
//         return null;
//     }
// 
// }


import org.echocat.gradle.plugins.golang.vcs.RawVcsReference;
import org.echocat.gradle.plugins.golang.vcs.VcsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.util.regex.Pattern.compile;
import static org.echocat.gradle.plugins.golang.vcs.VcsType.git;
package org.echocat.gradle.plugins.golang.vcs.isps;




public class GolangOrgVcsRepositoryProvider extends IspBasedVcsRepositoryProviderSupport {

    private static final Logger LOGGER = LoggerFactory.getLogger(GolangOrgVcsRepositoryProvider.class);

    protected static final Pattern REF_PATTERN = compile("^refs/(?:heads|tags)/v(?<version>[0-9]{1,9}(?:\\.[0-9]{1,9}(?:\\.[0-9]{1,9})?)?)$");

    public GolangOrgVcsRepositoryProvider() {
        super("golang.org/", compile("^(?<root>golang\\.org/x/(?<repo>[A-Za-z0-9_.\\-]+))(?<subPath>/[A-Za-z0-9_.\\-]+)*$"));
    }

    @Nonnull
    @Override
// Path: src/main/java/org/echocat/gradle/plugins/golang/vcs/RawVcsReference.java
// public class RawVcsReference extends BaseVcsReference {
// 
//     public RawVcsReference(@Nullable VcsType type, @Nonnull String id, @Nullable URI plain, @Nullable String ref, UpdatePolicy updatePolicy) {
//         super(type, id, plain, ref, updatePolicy);
//     }
// 
// }
// 
// Path: src/main/java/org/echocat/gradle/plugins/golang/vcs/VcsException.java
// public class VcsException extends IOException {
// 
//     public VcsException(String message) {
//         super(message);
//     }
// 
//     public VcsException(String message, Throwable cause) {
//         super(messageFor(message, cause), cause);
//     }
// 
//     public VcsException(Throwable cause) {
//         this(null, cause);
//     }
// 
//     protected static String messageFor(String message, Throwable cause) {
//         if (isNotEmpty(message)) {
//             return message;
//         }
//         if (cause != null) {
//             final String causeMessage = cause.getMessage();
//             if (isNotEmpty(causeMessage)) {
//                 return causeMessage;
//             }
//         }
//         return null;
//     }
// 
// }


// Path: src/main/java/org/echocat/gradle/plugins/golang/vcs/isps/GolangOrgVcsRepositoryProvider.java
import org.echocat.gradle.plugins.golang.vcs.RawVcsReference;
import org.echocat.gradle.plugins.golang.vcs.VcsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.util.regex.Pattern.compile;
import static org.echocat.gradle.plugins.golang.vcs.VcsType.git;

package org.echocat.gradle.plugins.golang.vcs.isps;




public class GolangOrgVcsRepositoryProvider extends IspBasedVcsRepositoryProviderSupport {

    private static final Logger LOGGER = LoggerFactory.getLogger(GolangOrgVcsRepositoryProvider.class);

    protected static final Pattern REF_PATTERN = compile("^refs/(?:heads|tags)/v(?<version>[0-9]{1,9}(?:\\.[0-9]{1,9}(?:\\.[0-9]{1,9})?)?)$");

    public GolangOrgVcsRepositoryProvider() {
        super("golang.org/", compile("^(?<root>golang\\.org/x/(?<repo>[A-Za-z0-9_.\\-]+))(?<subPath>/[A-Za-z0-9_.\\-]+)*$"));
    }

    @Nonnull
    @Override
    protected String rootFor(@Nonnull Matcher matcher, @Nonnull RawVcsReference rawReference) throws VcsException {