All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.larsgrefer.sass.embedded.importer.RelativeUrlImporter Maven / Gradle / Ivy

There is a newer version: 4.0.0-m2
Show newest version
package de.larsgrefer.sass.embedded.importer;

import lombok.RequiredArgsConstructor;

import javax.annotation.Nullable;
import java.net.URL;

@RequiredArgsConstructor
public class RelativeUrlImporter extends CustomUrlImporter {

    private final URL startUrl;

    @Nullable
    @Override
    public URL canonicalizeUrl(String url) throws Exception {
        URL newUrl = new URL(startUrl, url);

        if (isFile(newUrl)) {
            return newUrl;
        }
        else {
            return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy