<commit_before>import java.net.*;
import java.io.*;

public class HTTP_Post {
	static URL u;

	public static void main(String args[]) {
		String s = URLEncoder.encode("A Test string to send to a servlet");

		try {
			HTTP_Post post = new HTTP_Post();
			System.out.println("Stworzenie obiektu post ");
			post.u = new URL(
					"https://localhost:8443/Logowanie/PobierzDaneOdKlienta");
			System.out
					.println("powiazanie post z url, jestem przed nawiazaniem polaczenia");
			// Open the connection and prepare to POST
			URLConnection uc = u.openConnection();
			System.out.println("nawiazanie polaczenia ");
			uc.setDoOutput(true);
			uc.setDoInput(true);
			uc.setAllowUserInteraction(false);
			System.out
					.println("otworzenie strumieni: setDoOutput(true), setDoInput(true) , setAllowUserInteraction(false)");

			String fileName = "D:\\eclipse\\Semestr4\\lista6Klucz\\test.txt";
			File myFile = new File(fileName);
			byte[] mybytearray = new byte[(int) myFile.length()];
			FileInputStream fis = new FileInputStream(myFile);
			BufferedInputStream bis = new BufferedInputStream(fis);
			DataInputStream dis = new DataInputStream(bis);
			dis.readFully(mybytearray, 0, mybytearray.length);

			// Sending file name and file size to the server
			DataOutputStream dstream = new DataOutputStream(
					uc.getOutputStream());
			System.out.println("przed wyslaniem Stringa ");
			// The POST line
			dstream.writeUTF(myFile.getName());
			dstream.writeLong(mybytearray.length);
			dstream.write(mybytearray, 0, mybytearray.length);
			dstream.flush();
			System.out.println("!!!!!File " + fileName + " sent to Server.");
			dstream.close();
			System.out
					.println("po zamknieciu DataOutputStream(uc.getOutputStream())");
			// Read Response
			InputStream in = uc.getInputStream();
			System.out.println("otworzono strunien do zczytywania odpowiedzi");
			int x;
			System.out.println("~~~~Przed petla while zczytujaca odpwiedz");
			while ((x = in.read()) != -1) {
				System.out.write(x);
			}
			System.out.println("~~~~Po petla while zczytujacej odpwiedz");
			in.close();
			System.out.println("zamknieto strumien wejsciowy ");

			BufferedReader r = new BufferedReader(new InputStreamReader(in));
			StringBuffer buf = new StringBuffer();
			String line;
			System.out
					.println("otworzenie strumienia string bbuffer -> input;  przed petla while ");
			while ((line = r.readLine()) != null) {
				System.out
						.println("~~~~w petli~while~~zczytujacej odpowiedz z String buffer ");
				buf.append(line);
			}

		} catch (IOException e) {
			e.printStackTrace(); // should do real exception handling
		}
	}
}<commit_msg>pobierz dane odnosnie liczby logowan i nazwy uzytkownika<commit_after>import java.net.*;
import java.io.*;

public class HTTP_Post {
	static URL u;

	public static void main(String args[]) {
		String s = URLEncoder.encode("A Test string to send to a servlet");

		HTTP_Post post = new HTTP_Post();
		try {
			post.u = new URL(
					"https://localhost:8443/Logowanie/SpecjalneDaneDlaPlayera");
			// Open the connection and prepare to POST
			URLConnection uc = u.openConnection();
			uc.setDoOutput(true);
			uc.setDoInput(true);
			uc.setAllowUserInteraction(false);
			DataInputStream clientData = new DataInputStream(
					uc.getInputStream());
			int ileLogowan = clientData.readInt();
			System.out.println(ileLogowan);
			String uzytkownik = clientData.readLine();
			System.out.println(uzytkownik);
			
			
			//todo if ilosc zalogowan jest mniejsza = 1 to  wygeneruj klucz i keystorea i wyslij keystorea // a jesli nie to wyslij komunikat 
			clientData.close();
			System.out.println("zilosc zalogowan " + ileLogowan);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// try {
		// HTTP_Post post = new HTTP_Post();
		// System.out.println("Stworzenie obiektu post ");
		// post.u = new URL(
		// "https://localhost:8443/Logowanie/PobierzDaneOdKlienta");
		// System.out
		// .println("powiazanie post z url, jestem przed nawiazaniem polaczenia");
		// // Open the connection and prepare to POST
		// URLConnection uc = u.openConnection();
		// System.out.println("nawiazanie polaczenia ");
		// uc.setDoOutput(true);
		// uc.setDoInput(true);
		// uc.setAllowUserInteraction(false);
		// System.out
		// .println("otworzenie strumieni: setDoOutput(true), setDoInput(true) , setAllowUserInteraction(false)");
		//
		// String fileName = "D:\\eclipse\\Semestr4\\lista6Klucz\\test.txt";
		// File myFile = new File(fileName);
		// byte[] mybytearray = new byte[(int) myFile.length()];
		// FileInputStream fis = new FileInputStream(myFile);
		// BufferedInputStream bis = new BufferedInputStream(fis);
		// DataInputStream dis = new DataInputStream(bis);
		// dis.readFully(mybytearray, 0, mybytearray.length);
		//
		// // Sending file name and file size to the server
		// DataOutputStream dstream = new DataOutputStream(
		// uc.getOutputStream());
		// System.out.println("przed wyslaniem Stringa ");
		// // The POST line
		// dstream.writeUTF(myFile.getName());
		// dstream.writeLong(mybytearray.length);
		// dstream.write(mybytearray, 0, mybytearray.length);
		// dstream.flush();
		// System.out.println("!!!!!File " + fileName + " sent to Server.");
		// dstream.close();
		// System.out
		// .println("po zamknieciu DataOutputStream(uc.getOutputStream())");
		// // Read Response
		// InputStream in = uc.getInputStream();
		// System.out.println("otworzono strunien do zczytywania odpowiedzi");
		//
		// int x;
		// System.out.println("~~~~Przed petla while zczytujaca odpwiedz");
		// while ((x = in.read()) != -1) {
		// System.out.write(x);
		// }
		// System.out.println("~~~~Po petla while zczytujacej odpwiedz");
		// in.close();
		// System.out.println("zamknieto strumien wejsciowy ");
		//
		// BufferedReader r = new BufferedReader(new InputStreamReader(in));
		// StringBuffer buf = new StringBuffer();
		// String line;
		// System.out
		// .println("otworzenie strumienia string bbuffer -> input;  przed petla while ");
		// while ((line = r.readLine()) != null) {
		// System.out
		// .println("~~~~w petli~while~~zczytujacej odpowiedz z String buffer ");
		// buf.append(line);
		// }
		//
		// } catch (IOException e) {
		// e.printStackTrace(); // should do real exception handling
		// }
	}
}
{'fraction_non_alphanumeric': 0.146129541864139, 'fraction_numerical': 0.0036334913112164298, 'mean_word_length': 3.5416068866571018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2803764', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2106, 'n_words': 479}