Changeset 1270 for trunk/src/org/expeditee/gui/FrameIO.java
- Timestamp:
- 03/25/19 14:33:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameIO.java
r1257 r1270 43 43 import java.util.List; 44 44 import java.util.Map; 45 import java.util.function.Consumer; 45 46 import java.util.stream.Collectors; 46 47 … … 1349 1350 } 1350 1351 1351 public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings ) throws InvalidFramesetNameException, ExistingFramesetException {1352 public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException { 1352 1353 Frame profile = CreateFrameset(username, PROFILE_PATH, true); 1353 FrameUtils.CreateDefaultProfile(username, profile, initialSettings );1354 FrameUtils.CreateDefaultProfile(username, profile, initialSettings, toNotifyOnSet); 1354 1355 return profile; 1355 1356 } … … 1924 1925 } 1925 1926 1926 public static Path setupPersonalResources(String username) 1927 { 1927 public static Path setupPersonalResources(String username) { 1928 1928 Path personalResources = Paths.get(FrameIO.PARENT_FOLDER).resolve("resources-" + username); 1929 1929 personalResources.toFile().mkdir(); … … 1944 1944 1945 1945 return personalResources; 1946 } 1947 1948 public static void migrateFrame(Frame toMigrate, Path destinationDirectory) { 1949 Path source = Paths.get(toMigrate.getFramePathReal()); 1950 String destination = source.relativize(destinationDirectory).toString().substring(3).replace(File.separator, "/"); 1951 try { 1952 copyFileTree(source, destinationDirectory); 1953 } catch (IOException e) { 1954 System.err.println("FrameIO::migrateFrame: failed to migrate from to new location. Message: " + e.getMessage()); 1955 return; 1956 } 1957 try { 1958 FileWriter out = new FileWriter(source.toFile()); 1959 out.write("REDIRECT:" + destination); 1960 out.flush(); 1961 out.close(); 1962 } catch (IOException e) { 1963 System.err.println("FrameIO::migrateFrame: failed to update file [" + source + "] to redirect to [" + destination + "] following migration. Message: " + e.getMessage()); 1964 } 1946 1965 } 1947 1966
Note:
See TracChangeset
for help on using the changeset viewer.