refactoring
This commit is contained in:
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import ru.di9.mirror.core.Utils;
|
||||
import ru.di9.mirror.core.domain.ItemRecord2;
|
||||
import ru.di9.mirror.core.domain.ItemRecord;
|
||||
import ru.di9.mirror.core.handler.IndexOfHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +28,7 @@ public class IndexOfMavenController {
|
||||
@ModelAttribute("model") ModelMap model) {
|
||||
String path = correctingHttpPath(httpPath);
|
||||
|
||||
List<ItemRecord2> walker = indexOfHandler.walker(path);
|
||||
List<ItemRecord> walker = indexOfHandler.walker(path);
|
||||
List<ModelLink> links = new ArrayList<>();
|
||||
|
||||
StringBuilder sb = new StringBuilder("/maven");
|
||||
@@ -46,13 +46,13 @@ public class IndexOfMavenController {
|
||||
sb.setLength(resetLength);
|
||||
sb.append("/");
|
||||
resetLength = sb.length();
|
||||
for (ItemRecord2 itemRecord2 : walker) {
|
||||
for (ItemRecord itemRecord : walker) {
|
||||
if (Utils.isNotEmptyString(path)) {
|
||||
sb.append(path).append("/");
|
||||
}
|
||||
sb.append(itemRecord2.name());
|
||||
sb.append(itemRecord.name());
|
||||
|
||||
links.add(new ModelLink(itemRecord2.name() + (itemRecord2.isDir() ? "/" : ""), sb.toString()));
|
||||
links.add(new ModelLink(itemRecord.name() + (itemRecord.isDir() ? "/" : ""), sb.toString()));
|
||||
sb.setLength(resetLength);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user