Skip to content

Commit 0e8dd9f

Browse files
Use generated stubs
1 parent e7e432d commit 0e8dd9f

File tree

8 files changed

+387
-1230
lines changed

8 files changed

+387
-1230
lines changed
Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,10 @@
1-
/*
2-
* Copyright 2002-2017 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
1+
// Generated automatically from org.springframework.core.io.InputStreamSource for testing purposes
162

173
package org.springframework.core.io;
184

19-
import java.io.IOException;
205
import java.io.InputStream;
216

22-
/**
23-
* Simple interface for objects that are sources for an {@link InputStream}.
24-
*
25-
* <p>This is the base interface for Spring's more extensive {@link Resource} interface.
26-
*
27-
* <p>For single-use streams, {@link InputStreamResource} can be used for any
28-
* given {@code InputStream}. Spring's {@link ByteArrayResource} or any
29-
* file-based {@code Resource} implementation can be used as a concrete
30-
* instance, allowing one to read the underlying content stream multiple times.
31-
* This makes this interface useful as an abstract content source for mail
32-
* attachments, for example.
33-
*
34-
* @author Juergen Hoeller
35-
* @since 20.01.2004
36-
* @see java.io.InputStream
37-
* @see Resource
38-
* @see InputStreamResource
39-
* @see ByteArrayResource
40-
*/
41-
public interface InputStreamSource {
42-
43-
/**
44-
* Return an {@link InputStream} for the content of an underlying resource.
45-
* <p>It is expected that each call creates a <i>fresh</i> stream.
46-
* <p>This requirement is particularly important when you consider an API such
47-
* as JavaMail, which needs to be able to read the stream multiple times when
48-
* creating mail attachments. For such a use case, it is <i>required</i>
49-
* that each {@code getInputStream()} call returns a fresh stream.
50-
* @return the input stream for the underlying resource (must not be {@code null})
51-
* @throws java.io.FileNotFoundException if the underlying resource doesn't exist
52-
* @throws IOException if the content stream could not be opened
53-
*/
54-
InputStream getInputStream() throws IOException;
55-
7+
public interface InputStreamSource
8+
{
9+
InputStream getInputStream();
5610
}
Lines changed: 18 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,26 @@
1-
/*
2-
* Copyright 2002-2018 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
1+
// Generated automatically from org.springframework.core.io.Resource for testing purposes
162

173
package org.springframework.core.io;
184

195
import java.io.File;
20-
import java.io.IOException;
21-
import java.io.InputStream;
226
import java.net.URI;
237
import java.net.URL;
24-
import java.nio.channels.Channels;
258
import java.nio.channels.ReadableByteChannel;
26-
27-
import org.springframework.lang.Nullable;
28-
29-
/**
30-
* Interface for a resource descriptor that abstracts from the actual
31-
* type of underlying resource, such as a file or class path resource.
32-
*
33-
* <p>An InputStream can be opened for every resource if it exists in
34-
* physical form, but a URL or File handle can just be returned for
35-
* certain resources. The actual behavior is implementation-specific.
36-
*
37-
* @author Juergen Hoeller
38-
* @since 28.12.2003
39-
* @see #getInputStream()
40-
* @see #getURL()
41-
* @see #getURI()
42-
* @see #getFile()
43-
* @see WritableResource
44-
* @see ContextResource
45-
* @see UrlResource
46-
* @see FileUrlResource
47-
* @see FileSystemResource
48-
* @see ClassPathResource
49-
* @see ByteArrayResource
50-
* @see InputStreamResource
51-
*/
52-
public interface Resource extends InputStreamSource {
53-
54-
/**
55-
* Determine whether this resource actually exists in physical form.
56-
* <p>This method performs a definitive existence check, whereas the
57-
* existence of a {@code Resource} handle only guarantees a valid
58-
* descriptor handle.
59-
*/
60-
boolean exists();
61-
62-
/**
63-
* Indicate whether non-empty contents of this resource can be read via
64-
* {@link #getInputStream()}.
65-
* <p>Will be {@code true} for typical resource descriptors that exist
66-
* since it strictly implies {@link #exists()} semantics as of 5.1.
67-
* Note that actual content reading may still fail when attempted.
68-
* However, a value of {@code false} is a definitive indication
69-
* that the resource content cannot be read.
70-
* @see #getInputStream()
71-
* @see #exists()
72-
*/
73-
default boolean isReadable() {
74-
return exists();
75-
}
76-
77-
/**
78-
* Indicate whether this resource represents a handle with an open stream.
79-
* If {@code true}, the InputStream cannot be read multiple times,
80-
* and must be read and closed to avoid resource leaks.
81-
* <p>Will be {@code false} for typical resource descriptors.
82-
*/
83-
default boolean isOpen() {
84-
return false;
85-
}
86-
87-
/**
88-
* Determine whether this resource represents a file in a file system.
89-
* A value of {@code true} strongly suggests (but does not guarantee)
90-
* that a {@link #getFile()} call will succeed.
91-
* <p>This is conservatively {@code false} by default.
92-
* @since 5.0
93-
* @see #getFile()
94-
*/
95-
default boolean isFile() {
96-
return false;
97-
}
98-
99-
/**
100-
* Return a URL handle for this resource.
101-
* @throws IOException if the resource cannot be resolved as URL,
102-
* i.e. if the resource is not available as descriptor
103-
*/
104-
URL getURL() throws IOException;
105-
106-
/**
107-
* Return a URI handle for this resource.
108-
* @throws IOException if the resource cannot be resolved as URI,
109-
* i.e. if the resource is not available as descriptor
110-
* @since 2.5
111-
*/
112-
URI getURI() throws IOException;
113-
114-
/**
115-
* Return a File handle for this resource.
116-
* @throws java.io.FileNotFoundException if the resource cannot be resolved as
117-
* absolute file path, i.e. if the resource is not available in a file system
118-
* @throws IOException in case of general resolution/reading failures
119-
* @see #getInputStream()
120-
*/
121-
File getFile() throws IOException;
122-
123-
/**
124-
* Return a {@link ReadableByteChannel}.
125-
* <p>It is expected that each call creates a <i>fresh</i> channel.
126-
* <p>The default implementation returns {@link Channels#newChannel(InputStream)}
127-
* with the result of {@link #getInputStream()}.
128-
* @return the byte channel for the underlying resource (must not be {@code null})
129-
* @throws java.io.FileNotFoundException if the underlying resource doesn't exist
130-
* @throws IOException if the content channel could not be opened
131-
* @since 5.0
132-
* @see #getInputStream()
133-
*/
134-
default ReadableByteChannel readableChannel() throws IOException {
135-
return Channels.newChannel(getInputStream());
136-
}
137-
138-
/**
139-
* Determine the content length for this resource.
140-
* @throws IOException if the resource cannot be resolved
141-
* (in the file system or as some other known physical resource type)
142-
*/
143-
long contentLength() throws IOException;
144-
145-
/**
146-
* Determine the last-modified timestamp for this resource.
147-
* @throws IOException if the resource cannot be resolved
148-
* (in the file system or as some other known physical resource type)
149-
*/
150-
long lastModified() throws IOException;
151-
152-
/**
153-
* Create a resource relative to this resource.
154-
* @param relativePath the relative path (relative to this resource)
155-
* @return the resource handle for the relative resource
156-
* @throws IOException if the relative resource cannot be determined
157-
*/
158-
Resource createRelative(String relativePath) throws IOException;
159-
160-
/**
161-
* Determine a filename for this resource, i.e. typically the last
162-
* part of the path: for example, "myfile.txt".
163-
* <p>Returns {@code null} if this type of resource does not
164-
* have a filename.
165-
*/
166-
@Nullable
167-
String getFilename();
168-
169-
/**
170-
* Return a description for this resource,
171-
* to be used for error output when working with the resource.
172-
* <p>Implementations are also encouraged to return this value
173-
* from their {@code toString} method.
174-
* @see Object#toString()
175-
*/
176-
String getDescription();
177-
9+
import org.springframework.core.io.InputStreamSource;
10+
11+
public interface Resource extends InputStreamSource
12+
{
13+
File getFile();
14+
Resource createRelative(String p0);
15+
String getDescription();
16+
String getFilename();
17+
URI getURI();
18+
URL getURL();
19+
boolean exists();
20+
default ReadableByteChannel readableChannel(){ return null; }
21+
default boolean isFile(){ return false; }
22+
default boolean isOpen(){ return false; }
23+
default boolean isReadable(){ return false; }
24+
long contentLength();
25+
long lastModified();
17826
}
Lines changed: 16 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,21 @@
1-
/*
2-
* Copyright 2002-2020 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
1+
// Generated automatically from org.springframework.http.HttpEntity for testing purposes
162

173
package org.springframework.http;
18-
import org.springframework.lang.Nullable;
19-
import org.springframework.util.MultiValueMap;
20-
21-
public class HttpEntity<T> {
22-
public static final HttpEntity<?> EMPTY = null;
23-
24-
protected HttpEntity() {
25-
}
26-
27-
public HttpEntity(T body) {
28-
}
29-
30-
public HttpEntity(MultiValueMap<String, String> headers) {
31-
}
32-
33-
public HttpEntity(@Nullable T body, @Nullable MultiValueMap<String, String> headers) {
34-
}
354

36-
public HttpHeaders getHeaders() {
37-
return null;
38-
}
39-
40-
public T getBody() {
41-
return null;
42-
}
43-
44-
public boolean hasBody() {
45-
return false;
46-
}
47-
48-
@Override
49-
public boolean equals(@Nullable Object other) {
50-
return false;
51-
}
52-
53-
@Override
54-
public int hashCode() {
55-
return 0;
56-
}
57-
58-
@Override
59-
public String toString() {
60-
return null;
61-
}
5+
import org.springframework.http.HttpHeaders;
6+
import org.springframework.util.MultiValueMap;
627

8+
public class HttpEntity<T>
9+
{
10+
protected HttpEntity(){}
11+
public HttpEntity(MultiValueMap<String, String> p0){}
12+
public HttpEntity(T p0){}
13+
public HttpEntity(T p0, MultiValueMap<String, String> p1){}
14+
public HttpHeaders getHeaders(){ return null; }
15+
public String toString(){ return null; }
16+
public T getBody(){ return null; }
17+
public boolean equals(Object p0){ return false; }
18+
public boolean hasBody(){ return false; }
19+
public int hashCode(){ return 0; }
20+
public static HttpEntity<? extends Object> EMPTY = null;
6321
}

0 commit comments

Comments
 (0)