001package org.apache.maven.repository;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022/**
023 * Describes a resource being uploaded or downloaded by the repository system.
024 * 
025 * @author Benjamin Bentmann
026 */
027public interface ArtifactTransferResource
028{
029
030    /**
031     * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be
032     * terminated by a trailing slash.
033     * 
034     * @return The base URL of the repository or an empty string if unknown, never {@code null}.
035     */
036    String getRepositoryUrl();
037
038    /**
039     * The path of the artifact relative to the repository's base URL.
040     * 
041     * @return The path of the artifact, never {@code null}.
042     */
043    String getName();
044
045    /**
046     * Gets the full URL of the artifact.
047     * 
048     * @return The full URL of the artifact, never {@code null}.
049     */
050    String getUrl();
051
052    /**
053     * The size of the artifact in bytes.
054     * 
055     * @return The of the artifact in bytes or a negative value if unknown.
056     */
057    long getContentLength();
058
059    /**
060     * Gets the timestamp when the transfer of this artifact was started.
061     * 
062     * @return The timestamp when the transfer of this artifact was started.
063     */
064    long getTransferStartTime();
065
066}