Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
M1-INFO-Complexité-Project-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ILIEVA Viktoria
M1-INFO-Complexité-Project-1
Commits
8e39fbf6
Commit
8e39fbf6
authored
Oct 4, 2023
by
ddnguyen
Browse files
Options
Downloads
Patches
Plain Diff
add tools - FileScanner
parent
7ae0760a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/FileScanner.class
+0
-0
0 additions, 0 deletions
tools/FileScanner.class
tools/FileScanner.java
+29
-1
29 additions, 1 deletion
tools/FileScanner.java
with
29 additions
and
1 deletion
tools/FileScanner.class
+
0
−
0
View file @
8e39fbf6
No preview for this file type
This diff is collapsed.
Click to expand it.
tools/FileScanner.java
+
29
−
1
View file @
8e39fbf6
package
tools
;
package
tools
;
import
java.io.*
;
import
java.util.Scanner
;
public
class
FileScanner
{
public
class
FileScanner
{
private
final
File
file
;
private
Scanner
scanner
;
public
static
String
commentCharacter
=
"//"
;
public
FileScanner
(
final
String
filePath
)
{
this
.
file
=
new
File
(
filePath
);
try
{
this
.
scanner
=
new
Scanner
(
file
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
public
boolean
hasNextLine
()
{
return
scanner
.
hasNext
();
}
public
String
readLine
()
{
String
line
=
scanner
.
nextLine
();
// Check if the line does not start with the comment character
while
(
line
.
startsWith
(
commentCharacter
)
||
line
.
isEmpty
())
{
line
=
scanner
.
nextLine
();
}
return
line
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment