Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20230403
Commits
13eb02f5
Commit
13eb02f5
authored
May 26, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rest_klient
parent
53ff96e3
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
498 additions
and
0 deletions
+498
-0
pom.xml
PC39-Wielomodulowy/pom.xml
+2
-0
pom.xml
PC39-Wielomodulowy/rest_klient/pom.xml
+44
-0
P01_Url.java
.../rest_klient/src/main/java/sklep/klient_rest/P01_Url.java
+24
-0
P02_Url_Json.java
..._klient/src/main/java/sklep/klient_rest/P02_Url_Json.java
+33
-0
P03_HttpClient.java
...lient/src/main/java/sklep/klient_rest/P03_HttpClient.java
+33
-0
P04_HttpClient_Json.java
.../src/main/java/sklep/klient_rest/P04_HttpClient_Json.java
+53
-0
P05_RestClient.java
...lient/src/main/java/sklep/klient_rest/P05_RestClient.java
+53
-0
P06_RestClient_String.java
...rc/main/java/sklep/klient_rest/P06_RestClient_String.java
+34
-0
P07_RestClient_JAXB.java
.../src/main/java/sklep/klient_rest/P07_RestClient_JAXB.java
+32
-0
P08_RestClient_JSON_JedenProdukt.java
...a/sklep/klient_rest/P08_RestClient_JSON_JedenProdukt.java
+29
-0
P08_RestClient_JSON_Lista.java
...ain/java/sklep/klient_rest/P08_RestClient_JSON_Lista.java
+35
-0
P09_RestClient_Interaktywny.java
...n/java/sklep/klient_rest/P09_RestClient_Interaktywny.java
+61
-0
P10_RestClient_PDF.java
...t/src/main/java/sklep/klient_rest/P10_RestClient_PDF.java
+60
-0
Ustawienia.java
...st_klient/src/main/java/sklep/klient_rest/Ustawienia.java
+5
-0
No files found.
PC39-Wielomodulowy/pom.xml
View file @
13eb02f5
...
...
@@ -38,5 +38,6 @@
<module>
rest_serwer
</module>
<module>
model
</module>
<module>
baza
</module>
<module>
rest_klient
</module>
</modules>
</project>
\ No newline at end of file
PC39-Wielomodulowy/rest_klient/pom.xml
0 → 100644
View file @
13eb02f5
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
pl.alx.kjava
</groupId>
<artifactId>
PC39-Wielomodulowy
</artifactId>
<version>
1.0
</version>
</parent>
<artifactId>
rest_klient
</artifactId>
<properties>
<resteasy.version>
6.2.4.Final
</resteasy.version>
</properties>
<dependencies>
<dependency>
<groupId>
${project.groupId}
</groupId>
<artifactId>
model
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.glassfish
</groupId>
<artifactId>
jakarta.json
</artifactId>
<version>
2.0.1
</version>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-client
</artifactId>
<version>
${resteasy.version}
</version>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jaxb-provider
</artifactId>
<version>
${resteasy.version}
</version>
</dependency>
<dependency>
<groupId>
org.jboss.resteasy
</groupId>
<artifactId>
resteasy-jackson2-provider
</artifactId>
<version>
${resteasy.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P01_Url.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.nio.file.StandardCopyOption
;
public
class
P01_Url
{
public
static
void
main
(
String
[]
args
)
{
try
{
URL
url
=
new
URL
(
Ustawienia
.
ADRES_USLUGI
+
"/products.json"
);
try
(
InputStream
inputStream
=
url
.
openStream
())
{
Files
.
copy
(
inputStream
,
Paths
.
get
(
"wynik01.json"
),
StandardCopyOption
.
REPLACE_EXISTING
);
System
.
out
.
println
(
"OK"
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P02_Url_Json.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URL
;
import
jakarta.json.Json
;
import
jakarta.json.JsonArray
;
import
jakarta.json.JsonReader
;
import
jakarta.json.JsonValue
;
public
class
P02_Url_Json
{
public
static
void
main
(
String
[]
args
)
{
try
{
URL
url
=
new
URL
(
Ustawienia
.
ADRES_USLUGI
+
"/products.json"
);
try
(
InputStream
inputStream
=
url
.
openStream
();
JsonReader
reader
=
Json
.
createReader
(
inputStream
))
{
JsonArray
array
=
reader
.
readArray
();
// System.out.println(array);
for
(
JsonValue
jsonValue
:
array
)
{
//System.out.println(jsonValue);
System
.
out
.
println
(
jsonValue
.
asJsonObject
().
getString
(
"productName"
));
System
.
out
.
println
(
" opis: "
+
jsonValue
.
asJsonObject
().
getString
(
"description"
,
""
));
System
.
out
.
println
(
" cena: "
+
jsonValue
.
asJsonObject
().
getJsonNumber
(
"price"
).
bigDecimalValue
());
}
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P03_HttpClient.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.http.HttpClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse.BodyHandlers
;
public
class
P03_HttpClient
{
public
static
void
main
(
String
[]
args
)
{
HttpClient
httpClient
=
HttpClient
.
newHttpClient
();
try
{
URI
uri
=
new
URI
(
Ustawienia
.
ADRES_USLUGI
+
"/products.json"
);
HttpRequest
request
=
HttpRequest
.
newBuilder
(
uri
).
build
();
HttpResponse
<
String
>
response
=
httpClient
.
send
(
request
,
BodyHandlers
.
ofString
());
System
.
out
.
println
(
"response "
+
response
);
System
.
out
.
println
(
"status: "
+
response
.
statusCode
());
System
.
out
.
println
(
"Content-Type: "
+
response
.
headers
().
firstValue
(
"Content-Type"
).
orElse
(
"BRAK"
));
String
body
=
response
.
body
();
System
.
out
.
println
(
"Rozmiar treści: "
+
body
.
length
());
System
.
out
.
println
(
"\nCała treść:\n"
);
System
.
out
.
println
(
body
);
}
catch
(
URISyntaxException
|
IOException
|
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P04_HttpClient_Json.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.net.http.HttpClient
;
import
java.net.http.HttpRequest
;
import
java.net.http.HttpResponse
;
import
java.net.http.HttpResponse.BodyHandlers
;
import
jakarta.json.Json
;
import
jakarta.json.JsonArray
;
import
jakarta.json.JsonObject
;
import
jakarta.json.JsonReader
;
import
jakarta.json.JsonValue
;
public
class
P04_HttpClient_Json
{
public
static
void
main
(
String
[]
args
)
{
try
{
JsonArray
array
=
pobierzJsona
(
Ustawienia
.
ADRES_USLUGI
+
"/products.json"
);
for
(
JsonValue
jsonValue
:
array
)
{
JsonObject
jsonObject
=
jsonValue
.
asJsonObject
();
System
.
out
.
println
(
jsonObject
.
getString
(
"productName"
));
if
(
jsonObject
.
containsKey
(
"description"
))
{
System
.
out
.
println
(
" opis: "
+
jsonObject
.
getString
(
"description"
,
""
));
}
System
.
out
.
println
(
" cena: "
+
jsonObject
.
getJsonNumber
(
"price"
).
bigDecimalValue
());
}
}
catch
(
IOException
|
InterruptedException
|
URISyntaxException
e
)
{
e
.
printStackTrace
();
}
}
private
static
JsonArray
pobierzJsona
(
String
adres
)
throws
IOException
,
InterruptedException
,
URISyntaxException
{
HttpClient
httpClient
=
HttpClient
.
newHttpClient
();
URI
uri
=
new
URI
(
adres
);
HttpRequest
request
=
HttpRequest
.
newBuilder
(
uri
).
build
();
HttpResponse
<
InputStream
>
response
=
httpClient
.
send
(
request
,
BodyHandlers
.
ofInputStream
());
System
.
out
.
println
(
"response "
+
response
);
System
.
out
.
println
(
"status: "
+
response
.
statusCode
());
System
.
out
.
println
(
"Content-Type: "
+
response
.
headers
().
firstValue
(
"Content-Type"
).
orElse
(
"BRAK"
));
return
wczytajJsona
(
response
.
body
());
}
private
static
JsonArray
wczytajJsona
(
InputStream
input
)
{
try
(
JsonReader
reader
=
Json
.
createReader
(
input
))
{
return
reader
.
readArray
();
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P05_RestClient.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.client.Invocation
;
import
jakarta.ws.rs.client.WebTarget
;
import
jakarta.ws.rs.core.Response
;
// Ten i kolejne przykłady pokazują jak aplikacja kliencka napisana w Javie może wysyłać
// zapytania do usługi REST-owej (głównie GET, jest też gdzieś POST)
// korzystając z technologii JAX-RS "po stronie klienta".
// Aby z tego skorzystać, do projektu trzeba dodać bibliotekę z implementacją JAX-RS.
// Tutaj jest to resteasy-client.
public
class
P05_RestClient
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Startujemy"
);
Client
client
=
ClientBuilder
.
newClient
();
System
.
out
.
println
(
"Przygotowuję zapytanie"
);
WebTarget
target
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
).
path
(
"products.json"
);
Invocation
invocation
=
target
.
request
().
buildGet
();
System
.
out
.
println
(
"Wysyłam zapytanie"
);
Response
response
=
invocation
.
invoke
();
// Wynikiem jest obiekt klasy Response - tej samej, co na serwerze (używaliśmy np. do generowania kodów 404).
// W obiekcie można sprawdzić informacji o odpowiedzi: media type, status code.
System
.
out
.
println
(
"Mam odpowiedź: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"C-Type: "
+
response
.
getMediaType
());
System
.
out
.
println
(
"Length: "
+
response
.
getLength
());
// Aby odczytać zawartość zwróconą przez serwer, używamy metody readEntity.
// (przy domyślnych ustawieniach) tę metodę można wywołać tylko raz.
byte
[]
dane
=
response
.
readEntity
(
byte
[].
class
);
System
.
out
.
println
(
"Dane mają "
+
dane
.
length
+
" bajtów."
);
try
{
Files
.
write
(
Paths
.
get
(
"wynik05.json"
),
dane
);
System
.
out
.
println
(
"Zapisałem w pliku"
);
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"Koniec"
);
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P06_RestClient_String.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.core.Response
;
public
class
P06_RestClient_String
{
public
static
void
main
(
String
[]
args
)
{
Client
client
=
ClientBuilder
.
newClient
();
// Taki styl programowania to "fluent API"
Response
response
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
)
.
path
(
"products.json"
)
.
request
().
buildGet
()
.
invoke
();
System
.
out
.
println
(
"Mam odpowiedź: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"C-Type: "
+
response
.
getMediaType
());
System
.
out
.
println
(
"Length: "
+
response
.
getLength
());
// readEntity(OKREŚLENIE TYPU) stara się odczytać tresc odpowiedzi jako obiekt podanego typu
// Obsługiwane typy to m.in: byte[], String, InputStream, File
// Dodając odpowiednie "MeassgeBodyReader", możemy obsługiwać dowolne typy.
// W szczególności, gdy dodamy do projektu obsługę XML lub JSON (zob. zależności Mavena),
// będziemy mogli odczytywać dane w postaci obiektów naszego modelu, np. Product.
String
dane
=
response
.
readEntity
(
String
.
class
);
System
.
out
.
println
(
"Otrzymane dane:"
);
System
.
out
.
println
(
dane
);
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P07_RestClient_JAXB.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.core.Response
;
import
sklep.model.Product
;
import
sklep.model.ProductList
;
public
class
P07_RestClient_JAXB
{
public
static
void
main
(
String
[]
args
)
{
Client
client
=
ClientBuilder
.
newClient
();
Response
response
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
)
.
path
(
"products.xml"
)
.
request
().
buildGet
()
.
invoke
();
System
.
out
.
println
(
"Mam odpowiedź: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"C-Type: "
+
response
.
getMediaType
());
System
.
out
.
println
(
"Length: "
+
response
.
getLength
());
ProductList
products
=
response
.
readEntity
(
ProductList
.
class
);
System
.
out
.
println
(
"Otrzymane dane:"
);
for
(
Product
product
:
products
.
getProducts
())
{
System
.
out
.
println
(
product
);
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P08_RestClient_JSON_JedenProdukt.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.core.Response
;
import
sklep.model.Product
;
import
sklep.model.ProductList
;
public
class
P08_RestClient_JSON_JedenProdukt
{
public
static
void
main
(
String
[]
args
)
{
Client
client
=
ClientBuilder
.
newClient
();
Response
response
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
)
.
path
(
"products.json"
)
.
path
(
"1"
)
.
request
().
buildGet
()
.
invoke
();
System
.
out
.
println
(
"Mam odpowiedź: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"C-Type: "
+
response
.
getMediaType
());
System
.
out
.
println
(
"Length: "
+
response
.
getLength
());
Product
product
=
response
.
readEntity
(
Product
.
class
);
System
.
out
.
println
(
"Odczytany produkt: "
+
product
);
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P08_RestClient_JSON_Lista.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.util.List
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.core.GenericType
;
import
jakarta.ws.rs.core.Response
;
import
sklep.model.Product
;
import
sklep.model.ProductList
;
public
class
P08_RestClient_JSON_Lista
{
public
static
void
main
(
String
[]
args
)
{
Client
client
=
ClientBuilder
.
newClient
();
Response
response
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
)
.
path
(
"products.json"
)
.
request
().
buildGet
()
.
invoke
();
System
.
out
.
println
(
"Mam odpowiedź: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"C-Type: "
+
response
.
getMediaType
());
System
.
out
.
println
(
"Length: "
+
response
.
getLength
());
GenericType
<
List
<
Product
>>
typListy
=
new
GenericType
<
List
<
Product
>>()
{};
List
<
Product
>
products
=
response
.
readEntity
(
typListy
);
for
(
Product
product
:
products
)
{
System
.
out
.
println
(
product
);
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P09_RestClient_Interaktywny.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.math.BigDecimal
;
import
java.util.Scanner
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.client.Entity
;
import
jakarta.ws.rs.client.WebTarget
;
import
jakarta.ws.rs.core.MediaType
;
import
jakarta.ws.rs.core.Response
;
import
sklep.model.Product
;
public
class
P09_RestClient_Interaktywny
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Startujemy..."
);
Scanner
scanner
=
new
Scanner
(
System
.
in
);
Client
client
=
ClientBuilder
.
newClient
();
WebTarget
path
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
)
.
path
(
"products"
)
.
path
(
"{id}"
);
System
.
out
.
println
(
"Przygotowana ścieżka: "
+
path
);
while
(
true
)
{
System
.
out
.
print
(
"\nPodaj id: "
);
int
id
=
scanner
.
nextInt
();
if
(
id
==
0
)
break
;
Response
response
=
path
.
resolveTemplate
(
"id"
,
id
)
.
request
(
MediaType
.
APPLICATION_JSON
)
.
get
();
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"Content-Type: "
+
response
.
getMediaType
());
if
(
response
.
getStatus
()
==
200
)
{
Product
product
=
response
.
readEntity
(
Product
.
class
);
System
.
out
.
println
(
"Mam produkt:"
);
System
.
out
.
println
(
" Nazwa: "
+
product
.
getProductName
());
System
.
out
.
println
(
" Cena: "
+
product
.
getPrice
());
System
.
out
.
println
(
" Opis: "
+
product
.
getDescription
());
System
.
out
.
println
();
System
.
out
.
println
(
"Podaj zmianę ceny (0 aby nie zmieniać):"
);
BigDecimal
zmianaCeny
=
scanner
.
nextBigDecimal
();
if
(
zmianaCeny
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
BigDecimal
newPrice
=
product
.
getPrice
().
add
(
zmianaCeny
);
System
.
out
.
println
(
"PUT nowej ceny..."
);
Response
odpPut
=
path
.
path
(
"price"
).
resolveTemplate
(
"id"
,
id
).
request
()
.
put
(
Entity
.
entity
(
newPrice
,
MediaType
.
TEXT_PLAIN_TYPE
));
System
.
out
.
println
(
"PUT zakończył się kodem "
+
odpPut
.
getStatus
());
}
}
else
{
System
.
out
.
println
(
"nie mogę odczytać"
);
}
}
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/P10_RestClient_PDF.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.nio.file.StandardCopyOption
;
import
jakarta.ws.rs.client.Client
;
import
jakarta.ws.rs.client.ClientBuilder
;
import
jakarta.ws.rs.client.WebTarget
;
import
jakarta.ws.rs.core.MediaType
;
import
jakarta.ws.rs.core.Response
;
public
class
P10_RestClient_PDF
{
private
static
final
MediaType
PDF_TYPE
=
new
MediaType
(
"application"
,
"pdf"
);
public
static
void
main
(
String
[]
args
)
{
int
productId
=
1
;
System
.
out
.
println
(
"Startujemy..."
);
Client
client
=
ClientBuilder
.
newClient
();
WebTarget
root
=
client
.
target
(
Ustawienia
.
ADRES_USLUGI
);
Response
response
=
root
.
path
(
"products"
)
.
path
(
"{id}"
)
.
resolveTemplate
(
"id"
,
productId
)
.
request
()
.
accept
(
PDF_TYPE
)
.
buildGet
()
.
invoke
();
System
.
out
.
println
(
"Otrzymałem response: "
+
response
);
System
.
out
.
println
(
"Status: "
+
response
.
getStatus
());
System
.
out
.
println
(
"Content-Type: "
+
response
.
getMediaType
());
if
(
response
.
getStatus
()
!=
200
)
{
System
.
out
.
println
(
"Chyba coś nie tak, więc przerywam."
);
return
;
}
String
nazwaPliku
=
"wynik.pdf"
;
String
contentDisposition
=
response
.
getHeaderString
(
"Content-Disposition"
);
if
(
contentDisposition
!=
null
&&
contentDisposition
.
contains
(
";filename="
))
{
nazwaPliku
=
contentDisposition
.
split
(
";filename="
)[
1
];
}
try
(
InputStream
strumienDanych
=
response
.
readEntity
(
InputStream
.
class
))
{
long
ileBajtow
=
Files
.
copy
(
strumienDanych
,
Paths
.
get
(
nazwaPliku
),
StandardCopyOption
.
REPLACE_EXISTING
);
System
.
out
.
printf
(
"Zapisano %d bajtów do pliku %s\n"
,
ileBajtow
,
nazwaPliku
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"Gotowe"
);
}
}
PC39-Wielomodulowy/rest_klient/src/main/java/sklep/klient_rest/Ustawienia.java
0 → 100644
View file @
13eb02f5
package
sklep
.
klient_rest
;
public
class
Ustawienia
{
public
static
final
String
ADRES_USLUGI
=
"http://localhost:8080/rest_serwer"
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment