• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #477

04 Apr 2025 05:53PM UTC coverage: 35.124% (-5.1%) from 40.183%
#477

push

github

aalmiray
fix(deploy): Add missing Forgejo messages

Related to #1842

18210 of 51845 relevant lines covered (35.12%)

0.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.39
/core/jreleaser-model-impl/src/main/java/org/jreleaser/model/internal/download/HttpDownloader.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.model.internal.download;
19

20
import com.fasterxml.jackson.annotation.JsonIgnore;
21
import org.jreleaser.model.Active;
22
import org.jreleaser.model.internal.common.HttpDelegate;
23

24
import java.util.List;
25
import java.util.Map;
26

27
import static java.util.Collections.unmodifiableMap;
28
import static java.util.stream.Collectors.toList;
29
import static org.jreleaser.model.api.download.HttpDownloader.TYPE;
30

31
/**
32
 * @author Andres Almiray
33
 * @since 1.1.0
34
 */
35
public final class HttpDownloader extends AbstractDownloader<org.jreleaser.model.api.download.HttpDownloader, HttpDownloader>
36
    implements org.jreleaser.model.internal.common.Http {
37
    private static final long serialVersionUID = -3365213730876579690L;
38

39
    private final HttpDelegate delegate = new HttpDelegate();
1✔
40

41
    @JsonIgnore
1✔
42
    private final org.jreleaser.model.api.download.HttpDownloader immutable = new org.jreleaser.model.api.download.HttpDownloader() {
1✔
43
        private static final long serialVersionUID = -1955685895966905403L;
44

45
        private List<? extends Asset> assets;
46

47
        @Override
48
        public String getUsername() {
49
            return HttpDownloader.this.getUsername();
×
50
        }
51

52
        @Override
53
        public String getPassword() {
54
            return HttpDownloader.this.getPassword();
×
55
        }
56

57
        @Override
58
        public Authorization getAuthorization() {
59
            return HttpDownloader.this.getAuthorization();
×
60
        }
61

62
        @Override
63
        public Map<String, String> getHeaders() {
64
            return unmodifiableMap(HttpDownloader.this.getHeaders());
×
65
        }
66

67
        @Override
68
        public String getType() {
69
            return HttpDownloader.this.getType();
×
70
        }
71

72
        @Override
73
        public String getName() {
74
            return HttpDownloader.this.getName();
×
75
        }
76

77
        @Override
78
        public List<? extends Asset> getAssets() {
79
            if (null == assets) {
×
80
                assets = HttpDownloader.this.getAssets().stream()
×
81
                    .map(Downloader.Asset::asImmutable)
×
82
                    .collect(toList());
×
83
            }
84
            return assets;
×
85
        }
86

87
        @Override
88
        public Active getActive() {
89
            return HttpDownloader.this.getActive();
×
90
        }
91

92
        @Override
93
        public boolean isEnabled() {
94
            return HttpDownloader.this.isEnabled();
×
95
        }
96

97
        @Override
98
        public Map<String, Object> asMap(boolean full) {
99
            return unmodifiableMap(HttpDownloader.this.asMap(full));
×
100
        }
101

102
        @Override
103
        public String getPrefix() {
104
            return HttpDownloader.this.prefix();
×
105
        }
106

107
        @Override
108
        public Map<String, Object> getExtraProperties() {
109
            return unmodifiableMap(HttpDownloader.this.getExtraProperties());
×
110
        }
111

112
        @Override
113
        public Integer getConnectTimeout() {
114
            return HttpDownloader.this.getConnectTimeout();
×
115
        }
116

117
        @Override
118
        public Integer getReadTimeout() {
119
            return HttpDownloader.this.getReadTimeout();
×
120
        }
121
    };
122

123
    public HttpDownloader() {
124
        super(TYPE);
1✔
125
    }
1✔
126

127
    @Override
128
    public org.jreleaser.model.api.download.HttpDownloader asImmutable() {
129
        return immutable;
×
130
    }
131

132
    @Override
133
    public void merge(HttpDownloader source) {
134
        super.merge(source);
×
135
        delegate.merge(source.delegate);
×
136
    }
×
137

138
    @Override
139
    public String getUsername() {
140
        return delegate.getUsername();
×
141
    }
142

143
    @Override
144
    public void setUsername(String username) {
145
        delegate.setUsername(username);
×
146
    }
×
147

148
    @Override
149
    public String getPassword() {
150
        return delegate.getPassword();
×
151
    }
152

153
    @Override
154
    public void setPassword(String password) {
155
        delegate.setPassword(password);
×
156
    }
×
157

158
    @Override
159
    public Authorization getAuthorization() {
160
        return delegate.getAuthorization();
×
161
    }
162

163
    @Override
164
    public void setAuthorization(Authorization authorization) {
165
        delegate.setAuthorization(authorization);
×
166
    }
×
167

168
    @Override
169
    public void setAuthorization(String authorization) {
170
        delegate.setAuthorization(authorization);
×
171
    }
×
172

173
    @Override
174
    public Map<String, String> getHeaders() {
175
        return delegate.getHeaders();
×
176
    }
177

178
    public void setHeaders(Map<String, String> headers) {
179
        delegate.setHeaders(headers);
×
180
    }
×
181

182
    public void asMap(Map<String, Object> props) {
183
        delegate.asMap(props);
×
184
    }
×
185

186
    @Override
187
    public Authorization resolveAuthorization() {
188
        return delegate.resolveAuthorization();
1✔
189
    }
190

191
    @Override
192
    protected void asMap(boolean full, Map<String, Object> props) {
193
        delegate.asMap(props);
1✔
194
    }
1✔
195
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc