Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.net.Authenticator;
- import java.net.PasswordAuthentication;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- try {
- /* String down = args[0];k,kjlkj
- String url = args[1];
- int depth = Integer.parseInt(args[2]);
- if(down.contains("download")) {*/
- // Page page = new Page(url, depth);
- int depth =2;
- Page page = new Page("http://wiki.forbis.lt",depth);
- if(depth>0) {
- if (depth == 1) {
- page.downloadPageInfo();
- }
- if(depth > 1){
- page.downloadPageInfo();
- page.depthRefing();
- }
- /*}else {
- System.out.println("not working");
- }*/
- }
- }catch(NumberFormatException e){
- e.getMessage();
- }
- }
- static {
- System.out.println("user ir pass ivedimas: toks kaip prie pc su enter (proxiui)");
- Scanner scanner = new Scanner(System.in);
- String user = scanner.nextLine();
- String pass = scanner.nextLine();
- Authenticator.setDefault(
- new Authenticator() {
- @Override
- public PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(
- user, pass.toCharArray());
- }
- }
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement