WinSpotlight.java import java.io.*;import javax.imageio.ImageIO;import java.awt.image.BufferedImage;public class WinSpotlight {public static void main(String[] args) throws IOException {copy(new File(System.getProperties().getProperty("user
import java.io.*; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; public class WinSpotlight { public static void main(String[] args) throws IOException { copy(new File(System.getProperties().getProperty("user.home")+"\\AppData\\Local\\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets")); //renameToJpg(new File(".\\Assets")); } /*public static void renameToJpg(File file){ if(!file.exists()){ return; } File[] files = file.listFiles(); for(File f : files){ String fileName = f.getName(); if(fileName.equals("path.txt")||fileName.equals("RenameFile.class")){ continue; } int set = fileName.length(); if(fileName.lastIndexOf(".")>0){ set = fileName.lastIndexOf("."); } String name = fileName.substring(0, set); File newname = new File(file,name+".jpg"); f.renameTo(newname); } }*/ public static void copy(File resFile) throws IOException { if (!resFile.exists()) return; File horizontal = new File(".\\WinSpotlight\\Horizontal"); File vertical = new File(".\\WinSpotlight\\Vertical"); if(!horizontal.exists()) { horizontal.mkdirs(); } if(!vertical.exists()) { vertical.mkdirs(); } if (resFile.isFile()) { if(resFile.length()<61440L){ return; } File objFile = null; if(getPictureWidth(resFile)==1920){ objFile = new File(".\\WinSpotlight\\Horizontal\\" + resFile.getName() + ".jpg"); } else if(getPictureWidth(resFile)==1080) { objFile = new File(".\\WinSpotlight\\Vertical\\" + resFile.getName() + ".jpg"); } InputStream ins = new FileInputStream(resFile); FileOutputStream outs = new FileOutputStream(objFile); byte[] buffer = new byte[1024 * 512]; int length; while ((length = ins.read(buffer)) != -1) { outs.write(buffer, 0, length); } ins.close(); outs.flush(); outs.close(); } else { for (File sf : resFile.listFiles()) { copy(sf); } } } public static int getPictureWidth(File picture) throws IOException{ BufferedImage sourceImg =ImageIO.read(new FileInputStream(picture)); return sourceImg.getWidth(); } }