@@ -0,0 +1,2309 @@
+%0A/**%0A * Write a description of class addapp here.%0A * %0A * @author (Brendan Manning) %0A * @version (1.0.0)%0A */%0Aimport java.net.*;%0Aimport java.io.*;%0Aimport javax.net.ssl.HttpsURLConnection;%0Apublic class addapp%0A%7B%0A    public static void main(String%5B%5D args) %7B%0A      //this shouldn't ever be run%0A      //but in case it is, show a copyright notice%0A      System.out.println(%22jLinux 2 - (c) 2016 Brendan Manning%22);%0A    %7D%0A    public static boolean install(String app) %7B%0A        String urlString;%0A        urlString = %22https://www.jlinux.net/appstore/content/%22 + app + %22/%22;%0A        String fileString;%0A        fileString = urlString + app + %22.jar%22;%0A        String appDir;%0A        appDir = System.getProperty(%22user.dir%22) + File.separator + %22hdd%22 + File.separator + %22applications%22 + File.separator;%0A        URL u;%0A        try %7B%0A           u = new URL(urlString); %0A        %7D catch (java.net.MalformedURLException ume) %7B%0A           System.out.println(%22Program '%22 + app.toLowerCase() + %22' does not exist%22);%0A            return false;%0A        %7D%0A        HttpsURLConnection huc;%0A        try %7B%0A            huc =  (HttpsURLConnection)  u.openConnection(); %0A         %7D catch (java.io.IOException ioe) %7B%0A             System.out.println(%22App download failed!%22);%0A             return false;%0A         %7D%0A        try %7B%0A         huc.setRequestMethod(%22HEAD%22); %0A        %7D catch (java.net.ProtocolException pe) %7B%0A            System.out.println(%22App failed to download!%22);%0A            return false;%0A        %7D%0A        try %7B%0A           huc.connect(); %0A        %7D catch (java.io.IOException ioe2) %7B%0A            System.out.println(%22An Error Occured. Download stopped!%22);%0A            return false;%0A        %7D%0A        %0A        //try %7B%0A             //if (huc.getResponseCode() == HttpsURLConnection.HTTPS_OK) %7B%0A                  //URL does exist%0A                  System.out.println(%22Downloading App....%22);%0A                  //now actually download the file%0A                  dl.get(fileString, appDir);%0A                  return true;%0A             //%7D else %7B%0A                 //System.out.println(%22Sorry, that app does not exist%22);%0A                 //return false;%0A               // %7D%0A        //%7D //catch (java.io.IOException ioe3) %7B%0A         //   System.out.println(%22An error caused the download to fail!%22);%0A          //  return false;%0A        //%7D%0A    %7D%0A%7D%0A

Create addapp.java