Update SiteBuilderService.java
This commit is contained in:
parent
105f937921
commit
f3484dfa6d
@ -10,9 +10,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
|
||||
import com.realnet.Heplers.FileHelper;
|
||||
@ -129,6 +132,17 @@ public class SiteBuilderService {
|
||||
System.out.println(i + " file created ");
|
||||
}
|
||||
|
||||
String url = "http://157.66.191.31:30185/token/createfile1/182/345_123?folderName=" + siteBuilderName;
|
||||
|
||||
ResponseEntity<Object> get = GET(url);
|
||||
if (get.getStatusCodeValue() < 209) {
|
||||
System.out.println(" deplpoyed also");
|
||||
|
||||
} else {
|
||||
System.out.println("not deplpoyed ");
|
||||
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(new EntityResponse(i + " files created "), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@ -137,4 +151,20 @@ public class SiteBuilderService {
|
||||
return user;
|
||||
|
||||
}
|
||||
|
||||
public ResponseEntity<Object> GET(String get) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
ResponseEntity<Object> u = restTemplate.getForEntity(get, Object.class);
|
||||
|
||||
return u;
|
||||
|
||||
}
|
||||
|
||||
private HttpHeaders getHeaders() {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Content-Type", MediaType.APPLICATION_JSON_VALUE);
|
||||
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user